/* Customer portal: same monotone cream-on-black as the site, over a still, nearly dark film frame. */
body.portal { --dim: .9; min-height: 100vh; }
body.portal .film-grain { opacity: .2; }
body.portal main { position: relative; z-index: 1; }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.pbar { position: sticky; top: 0; z-index: 20; background: rgba(14, 13, 12, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.pbar-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.pbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.pbar-right a, .linkbtn {
  font-family: var(--type); font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cream-3); text-decoration: none; background: none; border: 0; padding: 10px 0; cursor: pointer;
}
.pbar-right a:hover, .linkbtn:hover { color: var(--cream); }
.pbar-tag { font-family: var(--type); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-3); border: 1px solid var(--cream-4); border-radius: 999px; padding: 3px 10px; }
@media (max-width: 520px) { .brand span { display: none; } .pbar-right { gap: 14px; } }

/* ---------- Cards ---------- */
.panel {
  background: rgba(20, 18, 16, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 18px; padding: 30px;
}
@media (max-width: 600px) { .panel { padding: 22px 18px; border-radius: 16px; } }
.panel h2 { font-family: var(--display); font-size: 26px; letter-spacing: -.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head .slate { margin: 0; }
.muted { color: var(--cream-3); }
.lede { color: var(--cream-2); font-size: 17px; margin-top: 12px; }
.fine { color: var(--cream-3); font-size: 14.5px; margin-top: 16px; }

/* ---------- Sign up / sign in ---------- */
.auth { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 40px 16px 64px; }
.auth-card { width: 100%; max-width: 560px; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 650; font-size: 20px; color: var(--cream); margin-bottom: 28px; }
.auth-brand svg { width: 30px; height: 21px; }
.auth h1, .dash h1 { font-family: var(--display); font-size: clamp(30px, 6vw, 44px); letter-spacing: -.02em; line-height: 1.05; }
.auth .slate { margin-bottom: 12px; }
.switch { margin-top: 22px; color: var(--cream-3); font-size: 15px; text-align: center; }
.switch a { color: var(--cream); }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 26px; }
.steps li { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background .3s ease; }
.steps li.on { background: var(--cream); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; margin-top: 20px; }
.label { font-family: var(--type); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-3); }
.label em { font-style: normal; font-weight: 400; letter-spacing: .04em; text-transform: none; color: var(--cream-4); }
.input {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 12px;
  background: rgba(246, 237, 221, .04); border: 1px solid var(--line); color: var(--cream);
  font: 16px/1.4 var(--body); transition: border-color .15s ease, background .15s ease;
}
.input::placeholder { color: var(--cream-4); }
.input:focus { outline: none; border-color: var(--cream-3); background: rgba(246, 237, 221, .07); }
.input[aria-invalid="true"] { border-color: var(--cream); }
textarea.input { min-height: 112px; resize: vertical; }
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f6eddd' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
select.input option, select.input optgroup { background: #1d1a17; color: var(--cream); }
input[type="datetime-local"].input { color-scheme: dark; }
.pw { position: relative; }
.pw .input { padding-right: 76px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 12px; background: none; border: 0; color: var(--cream-3); font: 700 12.5px var(--type); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.pw button:hover { color: var(--cream); }
.hint { color: var(--cream-3); font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button {
  min-height: 44px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--cream-2);
  font: 15.5px var(--body); transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pick button:hover { border-color: var(--cream-3); color: var(--cream); }
.pick button[aria-pressed="true"] { background: var(--cream); color: var(--ink); border-color: var(--cream); font-weight: 600; }

.actions { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.actions .btn { min-height: 50px; }
.actions .grow { flex: 1; }
@media (max-width: 560px) { .actions .btn { flex: 1; } }
button.btn { cursor: pointer; font-family: var(--body); }
.btn[disabled] { opacity: .5; cursor: progress; }
.form-error { margin-top: 18px; padding: 12px 16px; border: 1px solid var(--cream-3); border-radius: 12px; font-size: 15.5px; color: var(--cream); background: rgba(246, 237, 221, .06); }
.form-ok { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--cream-3); border-radius: 12px; font-size: 15.5px; color: var(--cream-2); }
.skip-link { display: block; margin: 16px auto 0; }

/* ---------- Dashboard ---------- */
.dash { padding-top: 40px; padding-bottom: 96px; max-width: 820px; }
.dash-head { margin-bottom: 28px; }
.dash-head .slate { margin-bottom: 10px; }
.stack { display: grid; gap: 16px; }
.stack > *, .threads > * { min-width: 0; }
.chip { display: inline-block; font-family: var(--type); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-2); border: 1px solid var(--cream-4); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.chip.solid { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.big-when { font-family: var(--display); font-size: clamp(24px, 4.5vw, 34px); line-height: 1.15; margin-top: 4px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 18px 0 0; }
.facts dt { font-family: var(--type); font-weight: 700; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cream-3); padding-top: 3px; }
.facts dd { margin: 0; color: var(--cream-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.facts dd a { color: var(--cream); }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
.empty { border: 1px dashed var(--cream-4); border-radius: 14px; padding: 22px; color: var(--cream-2); text-align: center; }
.empty .btn { margin-top: 16px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Projects */
.project + .project { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.project h3 { font-family: var(--display); font-size: 22px; }
.project .summary { color: var(--cream-2); margin-top: 8px; white-space: pre-wrap; }
.track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.track span { min-width: 0; overflow: hidden; text-overflow: ellipsis; border-top: 3px solid var(--line); padding-top: 8px; font-family: var(--type); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream-4); }
@media (max-width: 480px) { .track span { font-size: 10.5px; letter-spacing: .02em; } }
.track span.past { border-color: var(--cream-3); color: var(--cream-3); }
.track span.now { border-color: var(--cream); color: var(--cream); font-weight: 700; }
.updates { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.updates li { border-left: 1px solid var(--cream-4); padding-left: 14px; }
.updates time { display: block; font-family: var(--type); font-size: 12.5px; letter-spacing: .08em; color: var(--cream-3); }
.updates p { color: var(--cream-2); white-space: pre-wrap; margin-top: 2px; }

/* Messages */
.threads { display: grid; gap: 10px; margin-top: 22px; }
.thread { border: 1px solid var(--line); border-radius: 14px; background: rgba(246, 237, 221, .03); }
.thread > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.thread > summary::-webkit-details-marker { display: none; }
.thread > summary .t-sub { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread > summary .t-who { display: block; font-weight: 400; color: var(--cream-3); font-size: 14px; }
.thread-body { padding: 4px 16px 16px; display: grid; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.msg.mine { margin-left: auto; background: rgba(246, 237, 221, .1); }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; font-family: var(--type); font-size: 12px; letter-spacing: .06em; color: var(--cream-3); margin-bottom: 2px; }
.reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.reply textarea.input { min-height: 50px; height: 50px; flex: 1; }
@media (max-width: 520px) { .reply { flex-direction: column; align-items: stretch; } }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.tabs button { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--cream-2); font: 600 15px var(--body); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.tabs .count { font-family: var(--type); margin-left: 6px; opacity: .75; }
.group-label { font-family: var(--type); font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--cream-3); margin: 26px 0 10px; }
.group-label:first-child { margin-top: 0; }
.row-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: rgba(246, 237, 221, .03); }
.row-card + .row-card { margin-top: 10px; }
.row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-top h3 { font-family: var(--display); font-size: 21px; }
.row-top .muted { font-size: 15px; }
.contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.contact a { font-size: 14px; text-decoration: none; border: 1px solid var(--cream-4); border-radius: 999px; padding: 6px 12px; color: var(--cream); }
.contact a:hover { background: var(--card); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.inline .input { width: auto; flex: 1 1 220px; }
.client > summary { list-style: none; cursor: pointer; }
.client > summary::-webkit-details-marker { display: none; }
.client[open] > summary { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 12px; }
.copyline { display: flex; gap: 8px; margin-top: 10px; }
.copyline .input { font-family: var(--type); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--cream); color: var(--ink); font-weight: 600; padding: 12px 20px; border-radius: 999px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); }
.loading { color: var(--cream-3); font-family: var(--type); letter-spacing: .06em; padding: 40px 0; text-align: center; }
