:root {
  --ink: #14202e;
  --ink-soft: #3d4f63;
  --paper: #f3f6f8;
  --paper-2: #e8eef2;
  --line: #c9d5de;
  --gold: #c4891a;
  --gold-deep: #9a6a10;
  --teal: #1a6b6e;
  --teal-deep: #0f4a4d;
  --white: #ffffff;
  --danger: #b42318;
  --ok: #0f6b4c;
  --warn: #9a6a10;
  --max: 1100px;
  --pad: clamp(1rem, 3vw, 1.75rem);
  --font-display: "Prompt", "Anuphan", sans-serif;
  --font-body: "Anuphan", "Prompt", sans-serif;
  --radius: 6px;
  --shadow: 0 10px 30px rgba(20, 32, 46, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(196, 137, 26, 0.12), transparent 55%),
    radial-gradient(800px 400px at 100% 0%, rgba(26, 107, 110, 0.1), transparent 50%),
    linear-gradient(180deg, #eef3f6 0%, var(--paper) 45%, #e7edf1 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.is-admin {
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(26, 107, 110, 0.14), transparent 55%),
    linear-gradient(180deg, #e8eef2 0%, #f3f6f8 100%);
}

.impersonate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem var(--pad);
  background: #7c2d12;
  color: #fff7ed;
  font-size: 0.9rem;
}
.impersonate-bar strong { color: #fff; }
.impersonate-bar .btn {
  background: #fff;
  color: #7c2d12;
  border-color: #fff;
}
.impersonate-bar .btn:hover {
  background: #ffedd5;
  color: #7c2d12;
}

a { color: var(--teal-deep); }
a:hover { color: var(--gold-deep); }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding: 1.5rem 0 3rem; }
.is-auth .main { padding: 0.75rem 0 1rem; }
.is-auth .topbar__inner { min-height: 52px; }
.container { width: min(100% - (var(--pad) * 2), var(--max)); margin-inline: auto; }

.topbar {
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar--admin { border-bottom-color: rgba(26,107,110,0.25); }
.topbar__inner {
  width: min(100% - (var(--pad) * 2), var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: nowrap;
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0;
  margin-right: auto;
}
.brand__logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: min(180px, 52vw);
  object-fit: contain;
}
.is-auth .brand__logo { height: 40px; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: #fff; font-size: 0.95rem;
}
.topbar--admin .brand__mark {
  background: linear-gradient(135deg, var(--ink), var(--teal-deep));
}
.brand__text span { color: var(--gold-deep); font-weight: 600; }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav {
  display: flex;
  gap: 0.85rem;
  flex-wrap: nowrap;
  align-items: center;
}
.nav > a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.nav > a:hover { color: var(--ink); }
.nav-ico {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}
.nav > a:hover .nav-ico { opacity: 1; }
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.nav-dropdown__toggle:hover,
.nav-dropdown.is-active > .nav-dropdown__toggle {
  color: var(--ink);
}
.nav-dropdown__toggle:hover .nav-ico,
.nav-dropdown.is-active > .nav-dropdown__toggle .nav-ico {
  opacity: 1;
}
.nav-dropdown__caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.nav-dropdown.is-open > .nav-dropdown__toggle .nav-dropdown__caret {
  transform: rotate(180deg);
}
.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 12.5rem;
  padding: 0.35rem 0;
  margin-top: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  z-index: 2;
}
.nav-dropdown.is-open::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 13rem;
  height: calc(100% + 16rem);
  z-index: 1;
}
.nav-dropdown.is-open > .nav-dropdown__menu {
  display: block;
}
.nav-dropdown__menu a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-dropdown__menu a:hover,
.nav-dropdown__menu a.is-current {
  color: var(--ink);
  background: #f3f6f8;
}
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #e8eef2;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}
.nav-count--warn {
  background: #fff1d6;
  color: var(--gold-deep);
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-left: 0.35rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}
.topbar__user--in-nav .btn { white-space: nowrap; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
}
.page-head p { margin: 0.35rem 0 0; color: var(--ink-soft); }
.page-head__meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.35rem 0.85rem; font-size: 0.8rem; color: var(--ink-soft);
}
.page-head__meta-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.page-head__meta-item svg { width: 14px; height: 14px; opacity: 0.7; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
a.stat--link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
a.stat--link:hover {
  border-color: var(--teal);
  color: inherit;
  transform: translateY(-1px);
}
.stat__top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.stat__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #e8f2f2;
  color: var(--teal-deep);
}
.stat__icon svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.stat__label { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 0; }
.stat__value { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; }
.stat__sub { margin-top: 0.35rem; color: var(--ink-soft); font-size: 0.8rem; }
.stat--danger {
  border-color: #f3c2bd;
  background: #fff8f7;
}
.stat--danger .stat__value { color: var(--danger); }
.stat--tone-teal {
  background: linear-gradient(180deg, #f3faf9 0%, #fff 55%);
  border-color: #bfd9da;
}
.stat--tone-teal .stat__icon { background: #d8efef; color: var(--teal-deep); }
.stat--tone-teal .stat__value { color: var(--teal-deep); }
.stat--tone-sky {
  background: linear-gradient(180deg, #f3f7fc 0%, #fff 55%);
  border-color: #c5d7ea;
}
.stat--tone-sky .stat__icon { background: #dde8f5; color: #2f5f8a; }
.stat--tone-sky .stat__value { color: #2f5f8a; }
.stat--tone-warn {
  background: linear-gradient(180deg, #fff8ec 0%, #fff 55%);
  border-color: #f0d7a2;
}
.stat--tone-warn .stat__icon { background: #ffe8b8; color: var(--gold-deep); }
.stat--tone-warn .stat__value { color: var(--gold-deep); }
.stat--tone-danger {
  background: linear-gradient(180deg, #fff5f3 0%, #fff 55%);
  border-color: #f3c2bd;
}
.stat--tone-danger .stat__icon { background: #fadad6; color: var(--danger); }
.stat--tone-danger .stat__value { color: var(--danger); }
.stat--tone-muted .stat__icon { background: #eef1f4; color: #5b6b7c; }
.stats--compact .stat__value { font-size: 1.35rem; }

.th-sort {
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.th-sort:hover { color: var(--teal-deep); }
.th-sort.is-active { color: var(--teal-deep); }

table.data tr.is-overdue td {
  background: #fff8f7;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.panel__head {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
}
.panel__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.panel__ico {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel__ico svg {
  width: 0.9rem;
  height: 0.9rem;
  display: block;
}
.panel__ico--teal { background: #d8efef; color: var(--teal-deep); }
.panel__ico--warn { background: #ffe8b8; color: var(--gold-deep); }
.panel__ico--gold { background: #fff0cc; color: var(--gold-deep); }
.panel__body { padding: 1.1rem; }

.svc-name {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.svc-name__text { min-width: 0; }
.svc-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.svc-ico {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #eef1f4;
  color: #5b6b7c;
}
.svc-ico svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.svc-ico--radio { background: #ffe8cc; color: #b45309; }
.svc-ico--vdo { background: #e8e4ff; color: #5b4bb6; }
.svc-ico--autodj { background: #ddefff; color: #1d6fb8; }
.svc-ico--hosting { background: #d8efef; color: var(--teal-deep); }
.svc-ico--vm { background: #e4f3e8; color: #2f7a45; }
.svc-ico--custom { background: #eef1f4; color: #5b6b7c; }

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.data th, table.data td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--paper-2);
  text-align: left;
  vertical-align: top;
}
table.data th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: #fafcfd;
}
table.data tr:last-child td { border-bottom: 0; }
table.data a { text-decoration: none; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge--ok { background: #e8f7f0; color: var(--ok); border-color: #bfe8d4; }
.badge--warn { background: #fff6e5; color: var(--warn); border-color: #f0d7a2; }
.badge--danger { background: #fdeceb; color: var(--danger); border-color: #f3c2bd; }
.badge--muted { background: #eef1f4; color: #5b6b7c; border-color: #d5dde5; }
.badge--type { background: #e8f2f2; color: var(--teal-deep); border-color: #bfd9da; }

.date-remain { font-weight: 600; }
.date-remain--ok { color: var(--ok); }
.date-remain--warn { color: var(--warn); }
.date-remain--danger { color: var(--danger); }

.invoice-view-layout {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.invoice-view-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.invoice-view-layout--with-qr {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.9fr);
  align-items: start;
}

.domain-view-layout {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}
.domain-view-layout > .panel {
  min-width: 0;
  margin-bottom: 0;
}
.domain-view-layout__renew .panel__body {
  display: grid;
  gap: 1rem;
}
@media (min-width: 901px) {
  .domain-view-layout--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .domain-view-layout__renew {
    position: sticky;
    top: 4.75rem;
  }
}
@media (max-width: 900px) {
  .domain-view-layout--split {
    grid-template-columns: 1fr;
  }
  .domain-view-layout__renew {
    position: static;
  }
}

.invoice-qr-panel {
  position: sticky;
  top: 1rem;
}
.invoice-qr-panel .panel__head {
  text-align: center;
}
.invoice-qr-panel .panel__head h2 {
  width: 100%;
}
.invoice-qr-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.invoice-qr-amount {
  width: 100%;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.invoice-qr-amount__label {
  font-size: 0.85rem;
  opacity: 0.92;
}
.invoice-qr-amount__value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.2rem;
}
.invoice-qr-hint {
  margin: 0 0 1rem;
  line-height: 1.55;
}
.invoice-qr-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  margin-bottom: 0.85rem;
}
.invoice-qr-frame img {
  display: block;
  width: min(260px, 100%);
  height: auto;
  border-radius: 8px;
  margin: 0 auto;
}
.invoice-qr-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.75rem;
}
@media (max-width: 900px) {
  .invoice-view-layout--with-qr {
    grid-template-columns: 1fr;
  }
  .invoice-qr-panel {
    position: static;
  }
}

.radio-order-layout {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}
@media (min-width: 901px) {
  .radio-order-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }
  .radio-order-summary {
    position: sticky;
    top: 1rem;
  }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--teal);
  color: #fff;
}
.btn:hover { background: var(--teal-deep); color: #fff; }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn--ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn--danger:hover {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}
.btn-ico {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}
.btn--gold { background: var(--gold); }
.btn--gold:hover { background: var(--gold-deep); }
.btn--amber {
  background: #b45309;
  border-color: #b45309;
  color: #fff;
}
.btn--amber:hover { background: #92400e; color: #fff; }
.btn--sky {
  background: #1d6fb8;
  border-color: #1d6fb8;
  color: #fff;
}
.btn--sky:hover { background: #155a96; color: #fff; }
.svc-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.svc-actions__meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-left: 0.15rem;
}
.svc-actions__inline {
  display: inline-flex;
  margin: 0;
}
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn--block { width: 100%; }

.auth-wrap {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 0.5rem 0;
  width: 100%;
}
/* Admin login: sit near top like etax (not vertically centered) */
.is-admin .auth-wrap {
  min-height: 0;
  place-items: start center;
  padding: 3rem 0 1.5rem;
}
.is-auth .main .container {
  width: min(100% - 1.5rem, 420px);
  margin-inline: auto;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.25rem;
  box-sizing: border-box;
}
.auth-card h1 {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.auth-card .sub { color: var(--ink-soft); margin: 0 0 0.85rem; }
.auth-card form {
  margin-top: 0.85rem !important;
  width: 100%;
  display: block;
}
.auth-card .form-group { margin-bottom: 0.7rem; }
.auth-card .form-group input {
  width: 100%;
  box-sizing: border-box;
}
.auth-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.auth-card .auth-help a {
  color: var(--teal-deep);
  font-weight: 600;
}
@media (max-width: 480px) {
  .auth-card .form-row { grid-template-columns: 1fr; }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  width: 100%;
}
.auth-actions .btn,
.btn--auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100% !important;
  max-width: none;
  min-height: 44px;
  padding: 0.65rem 1rem;
  box-sizing: border-box;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  margin: 0;
}
.btn--google {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--google:hover {
  background: #f8f9fa;
  color: var(--ink);
  border-color: #dadce0;
}
.btn--line {
  background: #06c755;
  border-color: #06c755;
  color: #fff;
}
.btn--line:hover {
  background: #05b34c;
  border-color: #05b34c;
  color: #fff;
}
.oauth-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.auth-help {
  margin: 1rem 0 0;
  text-align: center;
}
.auth-note {
  margin: 0.65rem 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { color: var(--teal-deep); }

.modal {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: min(92vw, 340px);
  box-shadow: var(--shadow);
  background: var(--white);
  color: var(--ink);
}
.modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}
.modal__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.modal__close:hover { color: var(--ink); }
.modal__body {
  padding: 1rem 1.1rem 1.2rem;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  text-align: center;
}
.modal__lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}
.line-qr-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}
.line-qr-link img {
  display: block;
  width: 200px;
  height: 200px;
}
.line-oa-id {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: #06c755;
  letter-spacing: 0.02em;
}
.modal__body .btn--auth {
  margin-top: 0.25rem;
}

.modal--order {
  width: min(92vw, 420px);
}
.modal__body--order {
  display: grid;
  gap: 0.65rem;
  justify-items: stretch;
  text-align: left;
  padding-top: 0.85rem;
}
.order-pick {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
a.order-pick:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow);
  color: inherit;
  transform: translateY(-1px);
}
.order-pick--disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f7f8fa;
}
.order-pick__text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.order-pick__text strong {
  font-size: 1rem;
}
.order-pick__text .muted {
  font-size: 0.82rem;
}

@media (max-height: 720px) {
  .auth-wrap {
    min-height: 0;
    place-items: start center;
    padding: 0.25rem 0;
  }
  .auth-card {
    padding: 0.95rem 1.1rem 1.05rem;
  }
  .btn--auth { min-height: 40px; }
}

@media (max-width: 640px) {
  .is-auth .main {
    padding: 0.35rem 0 1rem;
  }
  .auth-wrap {
    min-height: 0;
    place-items: start center;
    padding: 0.15rem 0 0.5rem;
  }
  .auth-card {
    padding: 1rem 1rem 1.1rem;
  }
}

.form-group { margin-bottom: 0.95rem; }
.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 2px solid rgba(26,107,110,0.25);
  border-color: var(--teal);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.account-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.account-type-option {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-weight: 400;
}
.account-type-option input {
  width: auto;
  margin-top: 0.2rem;
  accent-color: var(--teal);
}
.account-type-option strong {
  display: block;
  font-size: 0.95rem;
}
.account-type-option small {
  display: block;
  color: var(--ink-soft);
  margin-top: 0.15rem;
  font-size: 0.8rem;
}
.account-type-option:has(input:checked) {
  border-color: var(--teal);
  background: #f0f7f7;
}

@media (max-width: 640px) {
  .account-type-options { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem var(--pad) 1rem;
    background: rgba(243, 246, 248, 0.98);
    border-bottom: 1px solid var(--line);
    z-index: 30;
  }

  .nav.is-open {
    display: flex;
  }

  .nav > a {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(201, 213, 222, 0.6);
    white-space: normal;
  }

  .nav-dropdown {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-dropdown__toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(201, 213, 222, 0.6);
    white-space: normal;
  }
  .nav-dropdown.is-open::after {
    display: none;
  }
  .nav-dropdown__menu {
    position: static;
    display: none;
    min-width: 0;
    margin: 0 0 0.35rem;
    padding: 0 0 0.35rem 0.85rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .nav-dropdown.is-open > .nav-dropdown__menu {
    display: block;
  }
  .nav-dropdown__menu a {
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(201, 213, 222, 0.45);
  }
  .nav-dropdown__menu a:last-child {
    border-bottom: 0;
  }

  .topbar__user--in-nav {
    margin: 0.75rem 0 0;
    padding: 0.75rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert--error { background: #fdeceb; color: var(--danger); border-color: #f3c2bd; }
.alert--ok { background: #e8f7f0; color: var(--ok); border-color: #bfe8d4; }
.alert--warn { background: #fff6e5; color: var(--warn); border-color: #f0d7a2; }
.alert--warn a { color: inherit; }

.filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.filters a, .filters span {
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.85rem;
  background: #fff;
}
.filters a.is-active, .filters span.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.55rem 1rem;
}
.dl dt { color: var(--ink-soft); }
.dl dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) {
  .dl { grid-template-columns: 1fr; }
}

/* Service detail: 2-column field cards with alternating label tones */
.svc-dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}
.svc-dl__item {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  min-width: 0;
}
.svc-dl__item--wide {
  grid-column: 1 / -1;
}
.svc-dl__item dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.svc-dl__item dd {
  margin: 0;
  font-weight: 500;
  word-break: break-word;
}
.svc-dl__item:nth-child(odd) {
  border-left: 3px solid var(--teal);
  background: linear-gradient(180deg, #f1f8f8 0%, #fff 60%);
}
.svc-dl__item:nth-child(odd) dt {
  color: var(--teal-deep);
}
.svc-dl__item:nth-child(even) {
  border-left: 3px solid var(--gold);
  background: linear-gradient(180deg, #fbf7ef 0%, #fff 60%);
}
.svc-dl__item:nth-child(even) dt {
  color: var(--gold-deep);
}
.ns-list {
  margin: 0;
  padding-left: 1.1rem;
}
.ns-list li { margin: 0.15rem 0; }
@media (max-width: 720px) {
  .svc-dl {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .svc-dl__item {
    grid-template-columns: minmax(6.5rem, 38%) 1fr;
    align-items: baseline;
    column-gap: 0.55rem;
    row-gap: 0;
    padding: 0.4rem 0.55rem 0.4rem 0.65rem;
  }
  .svc-dl__item--wide {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .svc-dl__item dt {
    font-size: 0.72rem;
    line-height: 1.25;
  }
  .svc-dl__item dd {
    font-size: 0.88rem;
    line-height: 1.35;
  }
}

.footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0 1.4rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.footer__inner {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.muted { color: var(--ink-soft); }
code.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95em;
  background: #f3f6f8;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.empty { padding: 1.5rem; text-align: center; color: var(--ink-soft); }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 1rem;
  align-items: start;
}
.profile-layout__side {
  position: sticky;
  top: 1rem;
}
.profile-layout__side .oauth-link-row {
  flex-direction: column;
  align-items: stretch;
}
.profile-layout__side .oauth-link-row__actions {
  justify-content: stretch;
}
.profile-layout__side .oauth-link-row__actions .btn,
.profile-layout__side .oauth-link-row__actions form {
  width: 100%;
}
.profile-layout__side .oauth-link-row__actions .btn {
  justify-content: center;
}

@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-layout__side {
    position: static;
  }
}

.oauth-link-list {
  display: grid;
  gap: 0.75rem;
}
.oauth-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.oauth-link-row__meta {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.oauth-link-row__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
}
.oauth-link-row__status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.oauth-link-row__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.oauth-link-row .btn--google,
.oauth-link-row .btn--line {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.oauth-link-row .btn--google {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.oauth-link-row .btn--google:hover {
  background: #f8f9fa;
  color: var(--ink);
}
.oauth-link-row .btn--line {
  background: #06c755;
  border-color: #06c755;
  color: #fff;
}
.oauth-link-row .btn--danger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Large year / term slider (domain renew, etc.) */
.years-slider {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, #fff 0%, #f7fafb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.years-slider__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.years-slider__label {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.years-slider__value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 4.5rem;
  justify-content: flex-end;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(196, 137, 26, 0.12);
  color: var(--gold-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.years-slider__value span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.years-slider__track-wrap {
  position: relative;
  padding: 0.55rem 0.15rem 0.2rem;
}
.years-slider__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}
.years-slider__input:focus {
  outline: none;
}
.years-slider__input:focus-visible {
  outline: 2px solid rgba(196, 137, 26, 0.45);
  outline-offset: 4px;
  border-radius: 8px;
}
.years-slider__input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* WebKit track + thumb */
.years-slider__input::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--gold) 0%,
    var(--gold) var(--years-pct, 0%),
    #d5dee6 var(--years-pct, 0%),
    #d5dee6 100%
  );
  box-shadow: inset 0 1px 2px rgba(20, 32, 46, 0.12);
}
.years-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  margin-top: -11px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff8e8 0%, #f0c46a 45%, var(--gold) 100%);
  border: 3px solid #fff;
  box-shadow:
    0 2px 8px rgba(20, 32, 46, 0.22),
    0 0 0 1px rgba(154, 106, 16, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.years-slider__input:active::-webkit-slider-thumb,
.years-slider__input:hover::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow:
    0 4px 14px rgba(20, 32, 46, 0.28),
    0 0 0 1px rgba(154, 106, 16, 0.35);
}

/* Firefox track + thumb */
.years-slider__input::-moz-range-track {
  height: 14px;
  border-radius: 999px;
  background: #d5dee6;
  box-shadow: inset 0 1px 2px rgba(20, 32, 46, 0.12);
}
.years-slider__input::-moz-range-progress {
  height: 14px;
  border-radius: 999px;
  background: var(--gold);
}
.years-slider__input::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff8e8 0%, #f0c46a 45%, var(--gold) 100%);
  border: 3px solid #fff;
  box-shadow:
    0 2px 8px rgba(20, 32, 46, 0.22),
    0 0 0 1px rgba(154, 106, 16, 0.25);
}

.years-slider__ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.15rem;
  padding: 0 0.35rem;
  user-select: none;
}
.years-slider__tick {
  width: 1.6rem;
  margin: 0;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
}
.years-slider__tick:hover {
  color: var(--ink);
  background: rgba(196, 137, 26, 0.1);
}
.years-slider__tick.is-active {
  color: var(--gold-deep);
  background: rgba(196, 137, 26, 0.16);
}
.years-slider__ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: -0.15rem;
}

@media (max-width: 480px) {
  .years-slider {
    padding: 0.9rem 0.85rem 1rem;
  }
  .years-slider__value {
    font-size: 1.4rem;
  }
  .years-slider__tick {
    width: 1.35rem;
    font-size: 0.72rem;
    padding: 0.45rem 0;
  }
  .years-slider__input::-webkit-slider-thumb,
  .years-slider__input::-moz-range-thumb {
    width: 40px;
    height: 40px;
  }
  .years-slider__input::-webkit-slider-thumb {
    margin-top: -13px;
  }
}

