/* Client portal: the home page's sunrise. Navy sky, white cards, yellow actions. Phone first. */
.portal { --page: #F3F6FA; position: relative; display: flex; flex-direction: column; min-height: 100svh; background: var(--page); isolation: isolate; }
.portal main { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.block { display: block; }
.right { text-align: right; }

/* Sky behind the top of every page */
.sky { position: absolute; inset: 0 0 auto; height: 100%; z-index: -1; overflow: hidden; background: linear-gradient(180deg, var(--night) 0%, var(--deep) 62%, #2F7C8E 100%); }
.signed-in .sky { height: 330px; }
.sky-sun { mix-blend-mode: screen; position: absolute; left: 50%; top: 340px; width: 900px; height: 900px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, #FFF1C1 0 24%, var(--sun-light) 34%, rgba(255, 183, 3, .35) 46%, rgba(255, 183, 3, 0) 70%); }
.signed-in .sky-sun { top: auto; bottom: 40px; left: 82%; width: 340px; height: 340px; transform: translate(-50%, 40%); }
.sky-land { position: absolute; inset: auto 0 0; width: 100%; height: 130px; }
.signed-in .sky-land { height: 90px; }
.sky-ground { fill: var(--page); }

.mock-banner { margin: 0; padding: .4em 16px; background: var(--sun); color: var(--night); font-size: .9rem; font-weight: 600; text-align: center; }
.portal-header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.kicker { margin: 0 0 .4em; font: 600 .85rem var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--ember); }
.dash-head .kicker { color: var(--sun-light); }

.card { background: #fff; border: 1px solid #E3E9F0; border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.25rem; font-weight: 600; color: var(--night); }
.portal-header .btn-ghost { background: transparent; }
.portal-header .btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-line { border: 1.5px solid var(--night); background: #fff; color: var(--night); }
.btn-line:hover { background: var(--night); color: #fff; }

/* Login */
.login { padding-block: clamp(12px, 4vh, 40px) 120px; }
.login-card { max-width: 440px; margin-inline: auto; border-top: 5px solid var(--sun); box-shadow: 0 24px 60px rgba(11, 37, 64, .35); }
.login-card h1 { font-size: 2.1rem; color: var(--night); }
label { display: block; font-weight: 600; margin: 14px 0 4px; }
input, textarea { width: 100%; padding: .7em .85em; font: inherit; color: inherit; border: 1.5px solid #B9C6D3; border-radius: 12px; background: #fff; }
input:focus, textarea:focus { border-color: var(--night); }
.form-error, .card .form-error { margin: 12px 0 0; padding: .65em .9em; border-radius: 12px; border-left: 4px solid #C62828; background: #FDECEA; color: #B71C1C; font-weight: 600; }
.form-ok, .card .form-ok { margin: 12px 0 0; padding: .65em .9em; border-radius: 12px; border-left: 4px solid var(--sun); background: #FFF6DC; font-weight: 600; }
.login-submit { width: 100%; margin-top: 18px; }
.demo-logins { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 14px; padding-top: 16px; border-top: 1px solid #E3E9F0; }
.demo-logins p { width: 100%; margin: 0; }
.login-new { margin: 0; }

/* Dashboard */
.dash { padding-block: 12px 48px; }
.dash-head h1 { font-size: clamp(2rem, 5vw, 2.9rem); color: #fff; text-shadow: 0 2px 20px rgba(11, 37, 64, .5); margin-bottom: 0; }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 18px 0 22px; padding: 6px; width: fit-content; max-width: 100%; background: rgba(11, 37, 64, .72); border-radius: 999px; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: .45em .7em; border-radius: 999px; color: #fff; font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }
.tabs a:hover { background: rgba(255, 255, 255, .14); }
.tabs a[aria-current="page"] { background: linear-gradient(135deg, var(--sun-light), var(--sun)); color: var(--night); }
.badge { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--sun); color: var(--night); font-size: .8rem; text-align: center; }
.tabs a[aria-current="page"] .badge { background: var(--night); color: #fff; }
#panel:focus { outline: none; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 16px; background: #fff; border-top: 4px solid var(--sun); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.tile strong { font: 700 1.3rem/1.2 var(--font-head); color: var(--night); }
.tile-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
a.tile { transition: transform .15s; }
a.tile:hover { transform: translateY(-2px); }
.pill { display: inline-block; padding: .05em .65em; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.ok { background: #DCE9F5; color: var(--night); }
.pill.new { margin-left: 8px; background: var(--sun-light); color: var(--night); }
.right strong { display: block; }
.block-pill { margin-top: 2px; }
.meter { height: 10px; border-radius: 999px; background: #E3E9F0; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--sun-light), var(--sun)); }
.cta-card { background: linear-gradient(135deg, var(--night), var(--deep)); color: #fff; }
.cta-card h2 { color: #fff; }
.cta-card p { color: rgba(255, 255, 255, .88); }

.rows { margin: 0; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: .6em 0; border-bottom: 1px solid #E3E9F0; }
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); }
.row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.notice { margin: 14px 0 0; padding: .7em .9em; border-radius: 12px; background: #FFF6DC; border-left: 4px solid var(--sun); font-size: .95rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: .7em 0; border-bottom: 1px solid #E3E9F0; }
.list-row:last-child { border-bottom: 0; }
.msg { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: .8em 0; background: none; border: 0; border-bottom: 1px solid #E3E9F0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.list li:last-child .msg { border-bottom: 0; }
.msg:hover .msg-subject { color: var(--deep); text-decoration: underline; }
.msg.unread .msg-subject { font-weight: 700; color: var(--night); }
.linkish { padding: 0; margin-bottom: 12px; background: none; border: 0; font: inherit; color: var(--deep); text-decoration: underline; cursor: pointer; }
#reply-form .btn { margin-top: 10px; }

dialog { width: min(480px, 100% - 32px); border: 0; border-top: 5px solid var(--sun); border-radius: var(--radius); padding: 24px; color: var(--ink); }
dialog h2 { color: var(--night); }
dialog::backdrop { background: rgba(11, 37, 64, .65); }
dialog form { margin-top: 16px; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.bubble { margin: 12px 0; padding: .7em .9em; border-radius: 12px; background: #F3F6FA; }
.bubble.mine { background: #FFF6DC; }
.bubble p { margin: 0 0 .3em; }
.email-preview { margin-top: 18px; padding: 16px; border: 1.5px dashed var(--muted); border-radius: 12px; }
.store-note { margin: 14px 0 0; }

/* Admin */
.scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: .85rem; }
table.data th, table.data td { padding: .55em .7em .55em 0; border-bottom: 1px solid #E3E9F0; white-space: nowrap; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
.pill.warn { background: #FFE2C7; color: #6E3200; }
.pill.off { background: #E3E9F0; color: var(--muted); }
.search { max-width: 320px; margin-bottom: 8px; }

.chart { position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 8px; font-size: .9rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font: 500 12px var(--font-body); fill: var(--muted); }
.chart .val { fill: var(--ink); font-weight: 600; }
.chart .month-hit { fill: transparent; }
.chart .month-hit:hover, .chart .month-hit:focus { fill: rgba(27, 73, 101, .06); outline: none; }
.tip { position: absolute; z-index: 2; padding: .4em .7em; border-radius: 10px; background: var(--night); color: #fff; font-size: .85rem; pointer-events: none; white-space: nowrap; transform: translate(-50%, -100%); }

.checkout-form { margin-top: 12px; }

/* Log in and account */
.package-card label { display: block; margin: 14px 0 4px; font-weight: 600; }
.package-card [hidden] { display: none; }
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.account-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.account-facts dt { color: var(--muted); }
.account-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.delete-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #DCE3EA; }
.delete-form label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: .95rem; }
.delete-form input { display: block; max-width: 320px; padding: .55em .8em; }
.delete-form button[type=submit] { display: block; margin-top: 12px; }
.login-card label { display: block; margin: 14px 0 4px; font-weight: 600; }
.login-card [hidden], #logout[hidden] { display: none; }

/* Base package page */
.package { padding-block: 12px 48px; }
.package-card { max-width: 560px; margin-inline: auto; border-top: 5px solid var(--sun); box-shadow: 0 24px 60px rgba(11, 37, 64, .25); }
.package-card h1 { font-size: 1.5rem; font-weight: 700; color: var(--night); margin-top: 1em; }
.package-card h2 { margin-top: 1.1em; }
.price { margin: 0; font-size: 1.1rem; }
.price strong { font: 800 3.2rem/1.1 var(--font-head); color: var(--night); }
.ticks { list-style: none; margin: 0 0 1em; padding: 0; }
.ticks li { position: relative; padding-left: 1.5em; margin-bottom: .35em; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .5em; width: .7em; height: .7em; border-radius: 50%; background: var(--sun); }
.package-cta { width: 100%; margin-top: 8px; }
.package-foot { margin: 12px 0 0; text-align: center; }

.portal-footer { padding: 18px 0; background: var(--night); color: #fff; font-size: .9rem; text-align: center; }
.portal-footer p { margin-block: 0; opacity: .85; }

@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (max-width: 480px) {
  .hide-phone { display: none; }
  table.data td:first-child { white-space: normal; }
  .tabs a { padding: .45em .55em; font-size: .88rem; }
}

.cell { margin: 0; text-align: left; font-weight: 600; }
