:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef4ee;
  --text: #17211b;
  --muted: #68736d;
  --line: #dde5df;
  --brand: #16735c;
  --brand-2: #0f9f7b;
  --accent: #d9902f;
  --danger: #bf3b3b;
  --shadow: 0 18px 45px rgba(20, 38, 30, .09);
}

body.theme-01 { --bg:#f6f7f4; --surface-2:#eef4ee; --brand:#16735c; --brand-2:#0f9f7b; --accent:#d9902f; }
body.theme-02 { --bg:#f5f8fb; --surface-2:#eaf2f8; --brand:#1d5f8f; --brand-2:#2b9ac7; --accent:#e0a82e; }
body.theme-03 { --bg:#f7f6fb; --surface-2:#efecf8; --brand:#6f4aa8; --brand-2:#9b6bd3; --accent:#d58b3d; }
body.theme-04 { --bg:#f8f6f2; --surface-2:#f1ede5; --brand:#7a5632; --brand-2:#a06d3c; --accent:#2f8f73; }
body.theme-05 { --bg:#f5f8f7; --surface-2:#e8f2f0; --brand:#0f6b6d; --brand-2:#19a0a0; --accent:#d47a32; }
body.theme-06 { --bg:#f8f7f5; --surface-2:#f0eee8; --brand:#4d6551; --brand-2:#7a946f; --accent:#bd7f2a; }
body.theme-07 { --bg:#f7f8fb; --surface-2:#eef1f8; --brand:#344f7a; --brand-2:#5f7fb8; --accent:#d28c2d; }
body.theme-08 { --bg:#fbf6f6; --surface-2:#f7eeee; --brand:#8f3748; --brand-2:#c85a6b; --accent:#2f8e77; }
body.theme-09 { --bg:#f4f8f4; --surface-2:#e8f2e8; --brand:#2d6b3f; --brand-2:#54a35f; --accent:#c27c24; }
body.theme-10 { --bg:#f5f6f8; --surface-2:#eceff3; --brand:#26384f; --brand-2:#60758d; --accent:#d49b2e; }
body.theme-11 { --bg:#f7faf9; --surface-2:#edf6f4; --brand:#14645f; --brand-2:#28b0a1; --accent:#b9772f; }
body.theme-12 { --bg:#faf7f4; --surface-2:#f3ece5; --brand:#8b4b30; --brand-2:#c06a43; --accent:#247c80; }
body.theme-13 { --bg:#f7f8f2; --surface-2:#eef0df; --brand:#596b24; --brand-2:#8ba03c; --accent:#b2633d; }
body.theme-14 { --bg:#f5f8fb; --surface-2:#eaf0f6; --brand:#225675; --brand-2:#3b8bb1; --accent:#c56549; }
body.theme-15 { --bg:#f8f5f8; --surface-2:#f0e9f0; --brand:#765069; --brand-2:#aa7897; --accent:#b9852e; }
body.theme-16 { --bg:#f5f9f5; --surface-2:#eaf4e9; --brand:#226850; --brand-2:#4f9a78; --accent:#c5463f; }
body.theme-17 { --bg:#f6f9fb; --surface-2:#e9f2f5; --brand:#235c68; --brand-2:#4ca1aa; --accent:#d18f34; }
body.theme-18 { --bg:#faf8f2; --surface-2:#f4efd9; --brand:#6e6123; --brand-2:#a28f35; --accent:#276f7e; }
body.theme-19 { --bg:#f7f5f3; --surface-2:#eee8e2; --brand:#5f4b3c; --brand-2:#94745d; --accent:#2e8064; }
body.theme-20 { --bg:#f4f7fa; --surface-2:#e8eef5; --brand:#2d4668; --brand-2:#587da7; --accent:#b55f36; }
body.theme-21 { --bg:#f4f8fa; --surface-2:#e8f2f6; --brand:#184f67; --brand-2:#42a7c2; --accent:#d98d2b; }
body.theme-22 { --bg:#f6faf7; --surface-2:#e8f4ec; --brand:#205b4f; --brand-2:#47a278; --accent:#c07d2c; }
body.theme-23 { --bg:#f8f6fb; --surface-2:#efeaf6; --brand:#563f73; --brand-2:#9070b8; --accent:#d2a43a; }
body.theme-24 { --bg:#fbf6f6; --surface-2:#f5e9ea; --brand:#87424b; --brand-2:#c45e68; --accent:#2f8175; }
body.theme-25 { --bg:#eef3f8; --surface-2:#dfe9f4; --brand:#26364e; --brand-2:#4d84b8; --accent:#d88b30; }
body.theme-26 { --bg:#f8faf9; --surface-2:#eef7f4; --brand:#2f6f62; --brand-2:#55b69d; --accent:#c26e31; }
body.theme-27 { --bg:#f7f8f1; --surface-2:#edf0dc; --brand:#4d612d; --brand-2:#8d9d42; --accent:#b96d35; }
body.theme-28 { --bg:#f4f8fb; --surface-2:#e7f0f7; --brand:#28587a; --brand-2:#4aa0c8; --accent:#c9822b; }
body.theme-29 { --bg:#faf6f8; --surface-2:#f3e8ed; --brand:#7b4b5c; --brand-2:#bd6f80; --accent:#348067; }
body.theme-30 { --bg:#f7f8f8; --surface-2:#eceff0; --brand:#2f4858; --brand-2:#6c9aa8; --accent:#c89432; }

body[class*="theme-"] .content-card > h2,
body[class*="theme-"] .sidebar-card > h2 {
  border-bottom-color: color-mix(in srgb, var(--brand) 20%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, #fff), #fff);
}

body[class*="theme-"] .site-avatar,
body[class*="theme-"] .brand-mark {
  color: var(--brand);
}

body[class*="theme-"] .visit-button,
body[class*="theme-"] .hero-search button,
body[class*="theme-"] .card-body input[type="submit"],
body[class*="theme-"] .card-body button {
  background: var(--accent);
}

body[class*="theme-"] .answer-card {
  border-right-color: var(--brand-2);
}

body.theme-21 .hero {
  min-height: 360px;
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
}
body.theme-21 .hero-copy,
body.theme-21 .hero h1,
body.theme-21 .hero-text,
body.theme-21 .hero-search { margin-inline: auto; }
body.theme-21 .hero-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.theme-21 .content-card,
body.theme-21 .sidebar-card { border-radius: 2px; box-shadow: none; border-top: 4px solid var(--brand-2); }

body.theme-22 .site-header { border-bottom: 8px solid var(--accent); }
body.theme-22 .hero { min-height: 340px; grid-template-columns: minmax(0, 1fr) 360px; }
body.theme-22 .hero-panel div { border-radius: 16px; }
body.theme-22 .page-grid-three { grid-template-columns: 300px minmax(0, 1fr) 300px; }
body.theme-22 .sidebar-card { border-right: 5px solid var(--brand-2); }

body.theme-23 .site-header { background: radial-gradient(circle at top, color-mix(in srgb, var(--brand-2) 55%, #fff), var(--brand)); }
body.theme-23 .hero { min-height: 460px; }
body.theme-23 .content-card,
body.theme-23 .sidebar-card,
body.theme-23 .site-info-panel { border-radius: 18px; box-shadow: 0 22px 50px rgba(65,42,88,.14); }
body.theme-23 .brand-mark { border-radius: 50%; }

body.theme-24 .topbar { border-bottom: 1px solid rgba(255,255,255,.22); }
body.theme-24 .hero { min-height: 320px; grid-template-columns: minmax(0, 1fr); }
body.theme-24 .hero-panel { grid-template-columns: repeat(3, 1fr); }
body.theme-24 .content-card > h2,
body.theme-24 .sidebar-card > h2 { background: var(--brand); color: #fff; }

body.theme-25 { --text:#15202f; }
body.theme-25 .site-header { background: linear-gradient(135deg, #172235, var(--brand)); }
body.theme-25 .site-main { padding-top: 36px; }
body.theme-25 .content-card,
body.theme-25 .sidebar-card { background: #fbfdff; border-color: #cdd9e6; }
body.theme-25 .hero-search { border-radius: 16px; }

body.theme-26 .site-header { background: #fff; color: var(--text); border-bottom: 1px solid var(--line); }
body.theme-26 .main-nav a,
body.theme-26 .brand small,
body.theme-26 .hero-text { color: var(--muted); }
body.theme-26 .eyebrow { color: var(--accent); }
body.theme-26 .hero { min-height: 330px; }
body.theme-26 .hero-panel div { background: var(--surface-2); border-color: var(--line); }

body.theme-27 .hero { grid-template-columns: 360px minmax(0, 1fr); }
body.theme-27 .hero-panel { order: -1; }
body.theme-27 .content-card,
body.theme-27 .sidebar-card { border-right: 6px solid var(--brand-2); }
body.theme-27 .just_categories > ul > li { min-height: 132px; }

body.theme-28 .site-header { background: linear-gradient(160deg, var(--brand), var(--brand-2)); }
body.theme-28 .hero { min-height: 380px; }
body.theme-28 .hero-search { max-width: none; border-radius: 999px; }
body.theme-28 .hero-search input,
body.theme-28 .hero-search button { border-radius: 999px; }
body.theme-28 .content-card,
body.theme-28 .sidebar-card { border-radius: 14px; }

body.theme-29 .hero { grid-template-columns: minmax(0, 1fr); text-align: right; }
body.theme-29 .hero-panel { grid-template-columns: repeat(3, 1fr); }
body.theme-29 .site-header { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand-2) 70%, #000)); }
body.theme-29 .footer-modern { border-top: 5px solid var(--accent); }

body.theme-30 .site-header { background: var(--bg); color: var(--text); }
body.theme-30 .main-nav a,
body.theme-30 .brand small,
body.theme-30 .hero-text { color: var(--muted); }
body.theme-30 .hero { min-height: 300px; grid-template-columns: minmax(0, 1fr); padding-bottom: 34px; }
body.theme-30 .hero-panel { display: none; }
body.theme-30 .content-card,
body.theme-30 .sidebar-card { box-shadow: none; border-radius: 0; border-inline: 0; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Tajawal", Tahoma, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.shell { width: 80%; max-width: 1320px; margin-inline: auto; }
.site-header {
  color: #fff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 94%, #000 6%), color-mix(in srgb, var(--brand-2) 78%, #000 22%)),
    url("../../MA.com-1/css/images/bg-main.png");
  background-size: cover;
}
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
  font-size: 24px;
}
.brand strong, .brand small { display: block; }
.brand small { color: rgba(255,255,255,.92); font-size: 12px; margin-top: -2px; }
.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.main-nav a {
  padding: 9px 13px;
  border-radius: 8px;
  color: rgba(255,255,255,.95);
  font-weight: 700;
}
.main-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.hero {
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  align-items: center;
  gap: 28px;
  padding: 44px 0 56px;
}
.eyebrow {
  margin: 0 0 10px;
  color: #ffd99e;
  font-weight: 800;
}
.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.15;
  letter-spacing: 0;
}
.hero-text {
  max-width: 680px;
  color: rgba(255,255,255,.94);
  font-size: 18px;
}
.hero-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  max-width: 720px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
}
.hero-search input, .hero-search button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
}
.hero-search input { padding: 0 16px; outline: 0; }
.hero-search button {
  padding: 0 28px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
.hero-panel {
  display: grid;
  gap: 12px;
}
.hero-panel div {
  padding: 18px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand-2) 34%, rgba(255,255,255,.13));
  border: 1px solid rgba(255,255,255,.18);
}
.hero-panel strong, .hero-panel span { display: block; }
.hero-panel span { color: rgba(255,255,255,.94); font-size: 14px; }
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 28px 0 44px;
}
.sidebar { display: grid; gap: 16px; }
.side-box, .content-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.side-box { padding: 18px; }
.side-box h2, .content-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
}
.side-box a {
  display: block;
  padding: 10px 0;
  color: var(--brand);
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.content { display: grid; gap: 18px; min-width: 0; }
.content-card { padding: 22px; }
.compact-card { padding: 18px; }
.card-body table { width: 100%; border-collapse: collapse; }
.card-body td, .card-body th { padding: 10px; border-bottom: 1px solid var(--line); }
.card-body input[type="text"],
.card-body input[type="email"],
.card-body input[type="search"],
.card-body textarea,
.card-body select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.card-body input[type="text"]:focus,
.card-body input[type="email"]:focus,
.card-body input[type="search"]:focus,
.card-body textarea:focus,
.card-body select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(15, 159, 123, .12);
}
.card-body input[type="submit"], .card-body button, .more a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

#add_data,
.smart-add-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

#add_data .title {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #0f5f4c;
  background: #f7faf8;
  font-weight: 900;
}

#add_data .inputs {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4ece7;
}

#add_data .inputs p {
  margin: 0;
}

#add_data label {
  color: #24352c;
  font-size: 15px;
  font-weight: 900;
}

#add_data small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.smart-add-tools {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border-right: 5px solid var(--accent);
  border-radius: 8px;
  background: #fff8ea;
}

.smart-add-tools strong {
  color: #80510f;
  font-size: 16px;
}

.smart-add-tools span {
  color: #6d5b38;
  font-size: 14px;
  font-weight: 700;
}

.url-fetch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.url-fetch-row input {
  direction: ltr;
  text-align: left;
}

.url-fetch-row button {
  min-height: 44px;
  border-radius: 6px;
  white-space: nowrap;
}

.select-search {
  background: #fff;
}

.smart-select {
  position: relative;
  z-index: 2;
}

.smart-select .select-search {
  margin: 0;
  height: 46px;
  padding: 8px 42px 8px 12px;
  border-radius: 6px;
  background:
    linear-gradient(45deg, transparent 50%, #62746a 50%) right 16px center / 8px 8px no-repeat,
    #fff;
  font-weight: 600;
}

.enhanced-select-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.smart-select-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 50;
  display: none;
  max-height: 238px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #d5e2db;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 38, 30, .16);
}

.smart-select-list.is-open {
  display: grid;
  gap: 4px;
}

.smart-select-list button,
.smart-select-list span {
  width: 100%;
  display: block;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-align: right;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
}

.smart-select-list button:hover {
  color: #fff;
  background: var(--brand);
}

#add_data .has-error label,
#smartAddFormStatus {
  color: var(--danger);
}

#add_data .is-invalid,
#add_data .has-error .select-search {
  border-color: var(--danger);
  background-color: #fff7f7;
}

#smartAddFormStatus {
  width: 100%;
  margin-bottom: 8px;
  font-weight: 900;
}

#add_data .submitform {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.site-footer {
  padding: 30px 0;
  color: #dfe7e2;
  background: #15221b;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.footer-grid p { margin: 6px 0 0; color: #abb8b1; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: #fff; font-weight: 700; }
.footer-modern {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  align-items: start;
  direction: rtl;
  text-align: right;
}
.footer-brand strong {
  display: block;
  color: #fff;
  font-size: 20px;
}
.footer-managed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
  direction: rtl;
  text-align: right;
}
.footer-column {
  display: grid;
  gap: 8px;
}
.footer-column h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 16px;
}
.footer-column a {
  color: #c8d7cf;
  font-weight: 700;
}
.footer-column a:hover { color: #fff; }
#footer, .menu-sedany, .well { display: contents; }
.panel, .list-group, .sites {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
.sites h2 { margin: 0 0 8px; font-size: 19px; }
.sites .url a { color: var(--brand); direction: ltr; unicode-bidi: embed; }
.sites .info, .sites .meta { color: var(--muted); }
.site-detail { display: grid; gap: 18px; }
.answer-card {
  padding: 16px 18px;
  border: 1px solid #cfe2d8;
  border-right: 5px solid var(--brand-2);
  border-radius: 8px;
  background: #f5fbf8;
}
.answer-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f5f4c;
  font-size: 18px;
  font-weight: 900;
}
.answer-card p {
  margin: 0;
  color: #314139;
  font-weight: 700;
}
.site-detail-hero {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f5faf7);
}
.site-avatar {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 42px;
  font-weight: 800;
}
.site-domain {
  margin: 0 0 6px;
  color: var(--brand);
  direction: ltr;
  text-align: right;
  font-weight: 800;
}
.site-detail-main h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.25;
}
.site-description {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 17px;
}
.site-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.visit-button, .soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 7px;
  font-weight: 800;
}
.visit-button { color: #fff; background: var(--brand); }
.soft-button {
  color: var(--brand);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.site-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.site-metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.site-metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.site-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}
.site-metric.good { border-color: #b9e7d5; background: #effbf6; }
.site-metric.warn { border-color: #f0d6a8; background: #fff8eb; }
.site-metric.bad { border-color: #efb3b6; background: #fff1f2; }
.site-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
}
.site-info-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.site-info-panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
}
.site-info-panel dl {
  margin: 0;
  display: grid;
  gap: 10px;
}
.site-info-panel dl div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.site-info-panel dt {
  color: var(--muted);
  font-weight: 800;
}
.site-info-panel dd { margin: 0; }
.site-info-panel a { color: var(--brand); font-weight: 800; }
.site-note { color: var(--muted); }
.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-list span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface-2);
  font-weight: 700;
  font-size: 13px;
}
.related-panel #sites_contents,
.related-panel .sites {
  box-shadow: none;
}

@media (max-width: 860px) {
  .shell { width: calc(100% - 24px); }
  .topbar { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .hero-search { grid-template-columns: 1fr; }
  .hero-search button { width: 100%; }
  .footer-grid { align-items: flex-start; flex-direction: column; }
  .footer-modern { grid-template-columns: 1fr; }
  .site-detail-hero,
  .site-detail-grid,
  .site-metrics-grid { grid-template-columns: 1fr; }
  .site-info-panel dl div { grid-template-columns: 1fr; gap: 3px; }
}

/* Compatibility layer for the legacy directory HTML. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

a,
p,
li,
td,
th,
div,
span,
strong,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: anywhere;
  word-break: normal;
}

a[href^="http"],
.sites .url,
.sites .url a,
.site-domain,
.card-body .url,
.card-body .url a {
  direction: ltr;
  unicode-bidi: embed;
  word-break: break-all;
}

img,
iframe,
embed,
object,
video,
table,
form,
fieldset {
  max-width: 100%;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.shell,
.topbar,
.brand,
.main-nav,
.hero,
.hero-copy,
.hero-panel,
.layout,
.sidebar,
.content,
.content-card,
.card-body,
.side-box,
.panel,
.sites,
.list-group,
.site-detail,
.site-detail-main,
.site-info-panel,
.col-md-3,
.col-md-4,
.col-md-6,
.col-md-8 {
  min-width: 0;
  max-width: 100%;
}

.content-card,
.side-box,
.panel,
.sites,
.site-info-panel,
.site-detail-hero,
.site-metric {
  overflow: hidden;
}

.layout {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.card-body > *,
.site-info-panel > *,
.sites > * {
  max-width: 100%;
}

.card-body table {
  width: 100%;
  table-layout: fixed;
}

.card-body td,
.card-body th {
  vertical-align: top;
}

.card-body input[type="text"],
.card-body input[type="email"],
.card-body input[type="password"],
.card-body input[type="search"],
.card-body input[type="url"],
.card-body textarea,
.card-body select,
.card-body input:not([type]),
.hero-search input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 58px);
}

.site-detail-hero {
  grid-template-columns: 86px minmax(0, 1fr);
}

.site-avatar {
  width: 86px;
  height: 86px;
}

.site-detail-main h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.site-metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.site-detail-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}

.site-info-panel dl div {
  grid-template-columns: minmax(90px, 140px) minmax(0, 1fr);
}

.site-info-panel dd,
.site-metric strong,
.tag-list span {
  min-width: 0;
  max-width: 100%;
}

#site_info,
#add_site,
#add_sites,
#comments,
.comments,
.archive,
.search,
.pagination,
.perpage {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.col-md-3,
.col-md-4,
.col-md-6,
.col-md-8 {
  width: 100%;
}

.col-md-3 + .col-md-6,
.col-md-4 + .col-md-8,
.col-md-8 + .col-md-4,
.col-md-6 + .col-md-3 {
  margin-top: 18px;
}

@media (max-width: 860px) {
  .layout,
  .site-detail-hero,
  .site-detail-grid,
  .site-metrics-grid,
  .site-info-panel dl div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .main-nav {
    width: 100%;
    justify-content: stretch;
  }

  .main-nav a {
    flex: 1 1 44%;
    padding-inline: 8px;
    text-align: center;
  }

  .hero {
    padding: 28px 0 34px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .content-card,
  .site-detail-hero,
  .site-info-panel,
  .side-box {
    padding: 16px;
  }

  .site-avatar {
    width: 68px;
    height: 68px;
    font-size: 30px;
  }

  .site-actions a {
    width: 100%;
  }
}

/* Full layout reset: primary content plus real sidebar widgets. */
body {
  font-family: "Tajawal", "Cairo", Tahoma, Arial, sans-serif;
  font-size: 16px;
}

.site-main {
  padding: 28px 0 48px;
}

.top-ad-row {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  min-height: 1px;
}

.top-ad-row img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 1;
  object-fit: contain;
}

.top-ad-row:empty {
  display: none;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-areas: "primary sidebar";
  gap: 22px;
  align-items: start;
}

.page-grid-three {
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  grid-template-areas: "sidebar primary sidebar-extra";
}

.page-grid-left {
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-areas: "sidebar-extra primary";
}

.page-grid-full {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "primary";
}

.page-primary,
.page-sidebar {
  min-width: 0;
}

.page-primary {
  grid-area: primary;
  display: grid;
  gap: 18px;
}

.page-sidebar {
  grid-area: sidebar;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.page-sidebar-extra {
  grid-area: sidebar-extra;
}

.content-card,
.sidebar-card,
.side-box,
.panel,
.sites,
.site-info-panel,
.site-detail-hero,
.site-metric {
  border: 1px solid #dfe7e1;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(22, 45, 34, .06);
}

.content-card {
  padding: 24px;
}

.sidebar-card {
  padding: 16px;
  overflow: hidden;
}

.content-card > h2,
.sidebar-card > h2 {
  margin: -16px -16px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7faf8;
  color: #13251d;
  font-size: 20px;
  line-height: 1.35;
}

.content-card > h2 {
  margin: -24px -24px 18px;
  padding: 16px 24px;
  font-size: 24px;
}

.sidebar-card .card-body,
.sidebar-card .card-body * {
  max-width: 100%;
}

.sidebar-card ul,
.content-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-card li {
  display: block;
  padding: 9px 0;
  border-bottom: 1px solid #edf1ee;
  line-height: 1.55;
}

.sidebar-card li:last-child {
  border-bottom: 0;
}

.sidebar-card li::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--brand);
  vertical-align: middle;
}

.sidebar-card a {
  color: #15241d;
  font-weight: 700;
}

.sidebar-card a:hover {
  color: var(--brand);
}

.sidebar-card form,
.sidebar-card table,
.sidebar-card .poll,
.sidebar-card .incategory {
  width: 100%;
}

.sidebar-card input,
.sidebar-card select,
.sidebar-card textarea {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font-family: inherit;
}

.sidebar-card input[type="submit"],
.sidebar-card button {
  background: var(--brand);
  color: #fff;
  border: 0;
  font-weight: 800;
}

.sidebar-card .incategory {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-card .incategory a {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef6f2;
  color: var(--brand);
  font-size: 13px;
}

.card-body {
  line-height: 1.85;
}

.card-body p {
  margin-top: 0;
}

.sites {
  padding: 16px;
  display: grid;
  gap: 6px;
}

.sites h2,
.sites p {
  margin-right: 0;
  margin-left: 0;
}

.sites .url {
  padding: 8px 10px;
  border-radius: 7px;
  background: #f7faf8;
}

.site-detail-hero {
  background: #f8fbf9;
}

.rating-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.rating_v {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 6px;
  direction: ltr;
  line-height: 1;
}

.rating_v span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #c7d0ca;
  background: #f3f6f4;
  border: 1px solid #dfe8e2;
  font-size: 24px;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.rating_v span.hover,
.rating_v span:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.rating_v span:hover {
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .page-grid,
  .page-grid-three {
    grid-template-columns: 1fr;
    grid-template-areas:
      "primary"
      "sidebar"
      "sidebar-extra";
    gap: 16px;
  }

  .page-sidebar,
  .page-sidebar-extra {
    position: static;
    order: 2;
  }

  .page-primary {
    order: 1;
  }
}

@media (max-width: 980px) {
  .page-grid,
  .page-grid-three,
  .page-grid-right,
  .page-grid-left,
  .page-grid-full {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
  }

  .page-primary {
    order: 1 !important;
    width: 100%;
  }

  .page-sidebar {
    order: 2 !important;
    width: 100%;
    position: static !important;
  }

  .page-sidebar-extra {
    order: 3 !important;
    width: 100%;
    position: static !important;
  }
}

/* Directory lists, categories, and pagination redesign. */
#sites,
.sites-list {
  display: grid;
  gap: 14px;
}

#sites .order,
.order {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  color: var(--muted);
  font-weight: 700;
}

#sites .order a,
.order a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  border: 1px solid #cfe3d8;
}

#sites .site,
.site-list-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 18px 18px 18px 22px;
  border: 1px solid #dfe7e1;
  border-right: 5px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(22, 45, 34, .055);
}

#sites .site + .site {
  margin-top: 0;
}

#sites .site h2,
.site-list-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

#sites .site h2 a,
.site-list-card h2 a {
  color: #0f5f4c;
  font-weight: 900;
}

#sites .site .url,
.site-list-card .url {
  margin: 0;
  padding: 9px 11px;
  border-radius: 7px;
  background: #f3f7f5;
  border: 1px solid #e3ece7;
  font-size: 14px;
}

#sites .site .url a,
.site-list-card .url a {
  color: #246a9b;
  font-weight: 700;
}

#sites .site .meta,
.site-list-card .meta {
  margin: 0;
  color: #4f5e56;
  line-height: 1.8;
}

#sites .site .info,
.site-list-card .info {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 0;
  color: #6f7b74;
  font-size: 14px;
}

#sites .site .info a,
.site-list-card .info a {
  color: var(--brand);
  font-weight: 800;
}

.pagination,
.perpage {
  margin: 20px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  direction: rtl;
}

.pagination ul {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination li,
.perpage a,
.perpage u {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #dbe6df;
  background: #f8fbf9;
  color: #26352d;
  font-weight: 800;
  text-decoration: none;
}

.pagination li.current,
.pagination li:hover,
.perpage u {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.pagination li.disabled {
  opacity: .55;
}

.content-card .card-body > ul,
.content-card .card-body .catgory,
.content-card .card-body .category,
.content-card .card-body .just_categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.content-card .card-body > ul > li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.content-card .card-body > ul > li > a {
  color: #0f5f4c;
  font-weight: 900;
}

.content-card .card-body > ul ul {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.content-card .card-body > ul ul li {
  padding: 7px 9px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #edf2ee;
  font-size: 14px;
}

.just_categories > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.just_categories > ul > li {
  position: relative;
  min-height: 104px;
  padding: 16px;
  border: 1px solid #dfe7e1;
  border-right: 5px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 45, 34, .055);
}

.just_categories > ul > li > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #0f5f4c;
  font-size: 18px;
  font-weight: 900;
}

.just_categories > ul > li > a::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--brand-2);
}

.just_categories .incategory {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: transparent;
}

.just_categories .incategory a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dcebe3;
  border-radius: 999px;
  color: #4e5d55;
  background: #f7faf8;
  font-size: 13px;
  font-weight: 700;
}

.manual-links {
  display: grid;
  gap: 0;
}

.featured-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.featured-site {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #dfe9e4;
  border-right: 5px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fbf9);
  box-shadow: 0 10px 24px rgba(22, 45, 34, .06);
}

.featured-site span {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  color: #80510f;
  background: #fff3d9;
  font-size: 12px;
  font-weight: 900;
}

.featured-site h3 {
  margin: 0;
  font-size: 20px;
}

.featured-site h3 a {
  color: #0f5f4c;
  font-weight: 900;
}

.featured-site p {
  margin: 0;
  color: #516058;
}

.featured-site .featured-url {
  direction: ltr;
  text-align: right;
  color: #246a9b;
  font-weight: 700;
  word-break: break-all;
}

.featured-site small {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1280px) {
  .shell {
    width: 86%;
  }
}

@media (max-width: 1080px) {
  .shell {
    width: calc(100% - 32px);
  }

  .page-grid,
  .page-grid-three,
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "primary"
      "sidebar"
      "sidebar-extra";
  }

  .sidebar,
  .page-sidebar,
  .page-sidebar-extra {
    position: static;
  }

  .page-primary {
    order: 1;
  }

  .page-sidebar {
    order: 2;
  }

  .page-sidebar-extra {
    order: 3;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .shell {
    width: calc(100% - 20px);
  }

  .topbar,
  .footer-inner,
  .site-detail-hero {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .brand {
    max-width: 100%;
  }

  .brand strong,
  .brand small {
    overflow-wrap: anywhere;
  }

  .main-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-nav a {
    text-align: center;
  }

  .topbar nav,
  .footer-links,
  .site-actions,
  .site-list-card .info,
  #sites .site .info {
    justify-content: flex-start;
  }

  .hero {
    padding: 26px 0;
  }

  .hero-search {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 32px;
    line-height: 1.25;
  }

  .content-card,
  .side-block,
  .sidebar-card,
  .site-list-card,
  #sites .site,
  .site-detail-hero,
  .site-info-panel,
  .site-metric,
  .featured-site,
  .just_categories > ul > li {
    padding: 14px;
  }

  .content-card > h2,
  .sidebar-card > h2 {
    margin: -14px -14px 14px;
    padding: 13px 14px;
  }

  .content-card .card-body > ul,
  .content-card .card-body .catgory,
  .content-card .card-body .category,
  .content-card .card-body .just_categories,
  .just_categories > ul,
  .featured-sites-grid {
    grid-template-columns: 1fr;
  }

  .url-fetch-row {
    grid-template-columns: 1fr;
  }

  .url-fetch-row button,
  #add_data .submitform input[type="submit"] {
    width: 100%;
  }

  #add_data .inputs {
    padding-bottom: 12px;
  }

  .side-block li,
  .manual-links a,
  .content-card .card-body > ul > li,
  .site-list-card,
  #sites .site {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .pagination ul,
  .perpage {
    justify-content: flex-start;
  }

  .rating_v {
    gap: 4px;
  }

  .rating_v span {
    width: 30px;
    height: 30px;
    font-size: 22px;
  }
}

@media (max-width: 460px) {
  .hero h1 {
    font-size: 28px;
  }

  .topbar nav a,
  .footer-links a,
  .pagination li,
  .perpage a,
  .perpage u {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 980px) {
  body.theme-21 .hero,
  body.theme-22 .hero,
  body.theme-23 .hero,
  body.theme-24 .hero,
  body.theme-25 .hero,
  body.theme-26 .hero,
  body.theme-27 .hero,
  body.theme-28 .hero,
  body.theme-29 .hero,
  body.theme-30 .hero {
    grid-template-columns: 1fr;
    text-align: right;
    min-height: auto;
  }

  body.theme-21 .hero-panel,
  body.theme-24 .hero-panel,
  body.theme-29 .hero-panel {
    grid-template-columns: 1fr;
  }

  body.theme-27 .hero-panel {
    order: 0;
  }

  .site-main > .page-grid,
  .site-main > .page-grid-three,
  .site-main > .page-grid-right,
  .site-main > .page-grid-left,
  .site-main > .page-grid-full {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    grid-template-areas: none !important;
    gap: 16px !important;
    width: 100% !important;
  }

  .site-main .page-primary {
    order: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .site-main .page-sidebar {
    order: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    position: static !important;
  }

  .site-main .page-sidebar-extra {
    order: 3 !important;
    width: 100% !important;
    min-width: 0 !important;
    position: static !important;
  }
}

@media (max-width: 560px) {
  .content-card,
  .sidebar-card,
  .site-detail,
  .site-detail-main,
  .site-info-panel,
  .answer-card {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: anywhere;
  }

  .site-detail-main h1 {
    font-size: 25px !important;
    line-height: 1.45 !important;
  }
}
