/* ── Map page specific styles ── */

/* ── MAP PAGE SPECIFIC STYLES ── */

    .map-intro {
      max-width: 780px;
      margin: 0 auto 72px;
      text-align: center;
    }

    .map-intro p {
      font-size: 1.1rem;
      line-height: 1.9;
    }

    /* ── AREA CODE GRID — full-width horizontal cards ── */
    .areacode-grid {
      display: flex;
      flex-direction: column;
      gap: 0;
      border: 2px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
    }

    .areacode-card {
      display: grid;
      grid-template-columns: 120px 1fr auto;
      grid-template-areas:
        "num  head  ex"
        "num  desc  ex";
      column-gap: 40px;
      align-items: start;
      padding: 32px 40px;
      border-bottom: 2px solid var(--border);
      background: var(--white);
      transition: background 0.2s;
    }

    .areacode-card:last-child,
    .areacode-card.no-right {
      border-bottom: none;
    }

    .areacode-card:hover {
      background: var(--off-white);
    }

    /* number column */
    .areacode-number {
      grid-area: num;
      font-family: 'Playfair Display', serif;
      font-size: 3.8rem;
      font-weight: 900;
      line-height: 1;
      letter-spacing: -0.02em;
      align-self: center;
      padding-right: 28px;
      border-right: 2px solid var(--border);
      text-align: center;
    }

    /* header cell: badge + role title */
    .areacode-head {
      grid-area: head;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      gap: 6px;
    }

    .areacode-status {
      display: inline-flex;
      align-self: flex-start;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 3px 10px;
      border-radius: 20px;
      width: fit-content;
    }

    .areacode-role {
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--dark-text);
      margin: 0;
    }

    /* body text */
    .areacode-desc {
      grid-area: desc;
      font-size: 1rem;
      color: var(--body-text);
      line-height: 1.8;
      margin: 0;
      padding-top: 6px;
    }

    /* example block — right column */
    .areacode-example {
      grid-area: ex;
      font-family: monospace;
      font-size: 0.92rem;
      background: var(--light-gray);
      padding: 14px 18px;
      border-radius: 6px;
      color: var(--dark-text);
      line-height: 2;
      white-space: nowrap;
      align-self: center;
      min-width: 320px;
    }

    .areacode-example .em-orange {
      color: var(--gold);
      font-weight: 700;
    }

    .status-active   { background: rgba(200,56,3,0.1);   color: var(--gold); }
    .status-perm     { background: rgba(21,38,68,0.1);   color: var(--navy); }
    .status-student  { background: rgba(200,56,3,0.07);  color: var(--gold); }
    .status-rd       { background: rgba(42,96,153,0.1);  color: #2a6099; }

    /* number accent colours */
    .ac-111 .areacode-number { color: var(--gold); }
    .ac-222 .areacode-number { color: var(--navy); }
    .ac-333 .areacode-number { color: #2a6099; }
    .ac-student .areacode-number { color: #8a3800; }
    .ac-rd .areacode-number { color: #2a6099; }

    /* ── Responsive: stack to vertical on narrow screens ── */
    @media (max-width: 860px) {
      .areacode-card {
        grid-template-columns: 1fr;
        grid-template-areas:
          "num"
          "head"
          "desc"
          "ex";
        gap: 12px;
        padding: 28px 24px;
      }
      .areacode-number {
        border-right: none;
        border-bottom: 2px solid var(--border);
        padding-right: 0;
        padding-bottom: 14px;
        font-size: 3rem;
        text-align: left;
      }
      .areacode-example {
        white-space: normal;
        min-width: 0;
      }
    }

    /* ── ALIAS FLOW DIAGRAM ── */
    .alias-flow {
      background: var(--navy);
      border-radius: 14px;
      padding: 52px 48px;
      position: relative;
      overflow: hidden;
    }

    .alias-flow::before {
      content: '';
      position: absolute;
      top: -80px; right: -80px;
      width: 400px; height: 400px;
      background: radial-gradient(circle, rgba(200,56,3,0.1) 0%, transparent 70%);
      pointer-events: none;
    }

    .flow-row {
      display: grid;
      grid-template-columns: 1fr 80px 1fr;
      gap: 0;
      align-items: center;
      margin-bottom: 36px;
    }

    .flow-row:last-child {
      margin-bottom: 0;
    }

    .flow-box {
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 10px;
      padding: 24px 26px;
    }

    .flow-box-label {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 10px;
    }

    .flow-box-value {
      font-family: monospace;
      font-size: 1rem;
      color: var(--white);
      line-height: 1.7;
      word-break: break-all;
    }

    .flow-box-value .hi { color: var(--gold); font-weight: 700; }
    .flow-box-value .hi2 { color: #7ec8ff; font-weight: 700; }

    .flow-box-note {
      font-size: 0.88rem;
      color: rgba(255,255,255,0.6);
      margin-top: 10px;
      line-height: 1.6;
    }

    .flow-arrow {
      text-align: center;
      font-size: 2rem;
      color: var(--gold);
    }

    .flow-legend {
      display: flex;
      gap: 28px;
      flex-wrap: wrap;
      margin-top: 36px;
      padding-top: 28px;
      border-top: 1px solid rgba(255,255,255,0.1);
    }

    .flow-legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.9rem;
    }

    .flow-legend-dot {
      width: 12px;
      height: 12px;
      border-radius: 3px;
      flex-shrink: 0;
    }

    .flow-legend-item span {
      color: rgba(255,255,255,0.75);
    }

    /* ── DOMAIN TABLE ── */
    .domain-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 1rem;
      margin-top: 40px;
    }

    .domain-table thead th {
      background: var(--navy);
      color: rgba(255,255,255,0.9);
      padding: 16px 20px;
      text-align: left;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.82rem;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      font-weight: 600;
    }

    .domain-table thead th:first-child { border-radius: 8px 0 0 0; }
    .domain-table thead th:last-child  { border-radius: 0 8px 0 0; }

    .domain-table tbody td {
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
      color: var(--body-text);
      vertical-align: middle;
      line-height: 1.6;
    }

    .domain-table tbody tr:last-child td { border-bottom: none; }
    .domain-table tbody tr:hover td { background: var(--off-white); }

    .domain-table td:first-child {
      font-family: monospace;
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--gold);
    }

    .domain-table td:nth-child(2) {
      font-weight: 600;
      color: var(--dark-text);
    }

    /* ── LIFECYCLE TIMELINE ── */
    .lifecycle {
      position: relative;
      padding-left: 40px;
    }

    .lifecycle::before {
      content: '';
      position: absolute;
      left: 14px;
      top: 10px;
      bottom: 10px;
      width: 3px;
      background: linear-gradient(to bottom, var(--gold), var(--navy));
      border-radius: 2px;
    }

    .lifecycle-step {
      position: relative;
      margin-bottom: 36px;
      padding: 28px 32px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 10px;
    }

    .lifecycle-step:last-child {
      margin-bottom: 0;
    }

    .lifecycle-step::before {
      content: '';
      position: absolute;
      left: -32px;
      top: 28px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--gold);
      border: 3px solid var(--white);
      box-shadow: 0 0 0 2px var(--gold);
    }

    .lifecycle-step:last-child::before {
      background: var(--navy);
      box-shadow: 0 0 0 2px var(--navy);
    }

    .lifecycle-label {
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 6px;
    }

    .lifecycle-step:last-child .lifecycle-label {
      color: var(--navy);
    }

    .lifecycle-step h3 {
      font-size: 1.15rem;
      margin-bottom: 8px;
    }

    .lifecycle-step p {
      font-size: 1rem;
      margin: 0;
      line-height: 1.8;
    }

    .lifecycle-example {
      font-family: monospace;
      background: var(--light-gray);
      padding: 8px 14px;
      border-radius: 5px;
      font-size: 0.92rem;
      margin-top: 12px;
      display: block;
      color: var(--dark-text);
    }

    .lifecycle-example .hi { color: var(--gold); font-weight: 700; }

    /* ── COMPARISON TABLE ── */
    .compare-wrap {
      overflow-x: auto;
    }

    .compare-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 1rem;
      min-width: 600px;
    }

    .compare-table th {
      background: var(--navy);
      color: rgba(255,255,255,0.9);
      padding: 16px 20px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.82rem;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      font-weight: 600;
      text-align: left;
    }

    .compare-table th.col-old  { background: #3a1e1e; }
    .compare-table th.col-new  { background: #1a2e48; }

    .compare-table td {
      padding: 15px 20px;
      border-bottom: 1px solid var(--border);
      vertical-align: top;
      line-height: 1.7;
      color: var(--body-text);
    }

    .compare-table td:first-child {
      font-weight: 600;
      color: var(--dark-text);
      white-space: nowrap;
    }

    .compare-table td.old { color: #7a3a3a; }
    .compare-table td.new { color: #1a4a2a; font-weight: 500; }

    .compare-table tr:last-child td { border-bottom: none; }
    .compare-table tr:hover td      { background: var(--off-white); }

    /* ── RESPONSIVE ── */
    @media (max-width: 900px) {
      .flow-row {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .flow-arrow {
        transform: rotate(90deg);
        font-size: 1.5rem;
      }
      .alias-flow {
        padding: 36px 24px;
      }
      .lifecycle {
        padding-left: 28px;
      }
      .lifecycle-step::before {
        left: -22px;
        width: 12px;
        height: 12px;
      }
    }

    @media (max-width: 640px) {
      .areacode-number { font-size: 2.8rem; }
    }
