/* Taken from Script Studio v33 (studio.css), plus Puni Hub additions at the end */
.page h1 { margin-top: 0; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
textarea.mono, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
pre.script { white-space: pre-wrap; background: #fafaf7; border: 1px solid #e5e2da; border-radius: 8px; padding: 12px; font-size: 14px; line-height: 1.55; }
pre.code { white-space: pre-wrap; }
.out { margin-top: 14px; }
.srcerr { background: #fff4f2; border: 1px solid #f1c2b8; border-radius: 8px; padding: 12px; margin: 10px 0; }
.srcerr dt { font-weight: 600; margin-top: 6px; }
.pill.st-done { background: #e3f4e6; color: #1d6b2c; }
.pill.st-needs_review { background: #fff3d6; color: #8a5a00; }
.pill.st-source_error, .pill.st-error { background: #fde4e0; color: #9b2b1a; }
.pill.st-running { background: #e6eefc; color: #2446a0; }
#nav a.on { font-weight: 600; }
.toast.show { opacity: 1; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; vertical-align: middle; }
.badge.ok { background: #e3f4e6; color: #1d7a33; }
.badge.no { background: #f1f1ee; color: #8a8a83; font-weight: 500; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 4px; }
.dot.ok { background: #22a447; } .dot.no { background: #d0d0c8; }
.svc-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.svc { border: 1px solid #ddd9cf; border-radius: 10px; padding: 8px 14px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.svc.on { border-color: #22a447; background: #f2fbf4; font-weight: 600; }
.warn { color: #9b5b00; }
.mtext { margin-top: 6px; }
.nav-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9a978e; margin: 16px 12px 4px; }
.prompts { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
.plist { max-height: 75vh; overflow: auto; }
.plist details { margin-bottom: 8px; }
.plist .doc { display: block; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.plist .doc:hover { background: #f3f2ee; }
.plist .doc.on { background: #e6eefc; font-weight: 600; }
.stage { display: inline-block; min-width: 22px; font-size: 11px; color: #fff; background: #555; border-radius: 4px; text-align: center; margin-right: 6px; padding: 0 4px; }
.doc-text { width: 100%; min-height: 60vh; font-size: 12.5px; line-height: 1.5; }
.sticky-save { position: sticky; bottom: 0; background: #fafaf8; padding: 10px 0; }
@media (max-width: 900px) { .prompts { grid-template-columns: 1fr; } }
.admin-link { display: block; margin: 14px 12px 0; font-size: 13px; color: #2446a0; text-decoration: none; }
.admin-link:hover { text-decoration: underline; }
body.admin .side { background: #1f2430; color: #e9ebf0; }
body.admin .side a, body.admin .side .me, body.admin .side .ver, body.admin .nav-head { color: #e9ebf0; }
body.admin .side .admin-link { color: #9fc0ff; }
body.admin #nav a.on { background: rgba(255,255,255,.12); }
body.admin .auth-app { color: #9b2b1a; }

/* "Remember this computer" on both sign-in pages */
#authForm label.remember { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 10px 0 14px; font-weight: 500; font-size: 14px; cursor: pointer; }
#authForm label.remember input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: #0b1f4d; }

/* AI settings: current status, one service at a time, detail settings */
.badge.bad { background: #fde8e6; color: #a32116; }
.status-card h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.st-row { display: flex; flex-direction: column; gap: 3px; background: #f7f7f4; border-radius: 10px; padding: 10px 12px; min-width: 0; }
.st-row span { font-size: 12px; }
.st-row b { font-size: 14px; overflow-wrap: anywhere; }
.opt-head { margin: 18px 0 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.opts input[type=range] { flex: 1; min-width: 0; }
.opts label.inline { display: flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; font-size: 13px; }
.opts label.inline input { width: auto; }
.o-tval { font-weight: 700; margin-left: 4px; }
@media (max-width: 900px) { .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: 1fr; } }

/* Usage and cost */
.ic-coin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M15 9.5c-.5-1-1.6-1.5-3-1.5-1.7 0-3 .9-3 2s1.3 1.7 3 2 3 .9 3 2-1.3 2-3 2c-1.4 0-2.5-.5-3-1.5M12 6v2M12 16v2'/%3E%3C/svg%3E"); }
.u-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.u-card { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.u-card b { font-size: 22px; }
.u-grid { align-items: start; }
.u-grid .card { margin: 0; }
#page-usage .row.wrap { flex-wrap: wrap; align-items: center; }
#uPrices input { width: 100%; min-width: 0; }
#uPrices td:first-child { width: 45%; }
.u-aud { display: block; max-width: 320px; margin: 12px 0; }
@media (max-width: 900px) { .u-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.timing { margin: 6px 0 10px; display: grid; gap: 4px; }
.phases { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 2px; }
.phase { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f1f1ee; color: #8a8a83; }
.phase.ok { background: #e3f4e6; color: #1d6b2c; }
.phase.ok::before { content: "✓ "; }
.phase.now { background: #e6eefc; color: #2446a0; font-weight: 600; animation: pulse 1.6s ease-in-out infinite; }
.phases .arrow { color: #c4c2ba; font-size: 12px; }
@keyframes pulse { 50% { opacity: .55; } }

.qtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 -1px; position: relative; z-index: 1; }
.qtab { border: 1px solid #e3e1da; border-bottom: none; background: #f4f3ef; color: #55534c; border-radius: 10px 10px 0 0; padding: 7px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.qtab.on { background: #fff; color: #111; font-weight: 600; }
.qtab.add { font-weight: 700; padding: 7px 14px; }
.qtab .tnum { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: #0b1f4d; color: #fff; font-size: 11px; text-align: center; }
.qtab .tclose { margin-left: 4px; color: #9a978e; font-weight: 700; }
.qtab .tclose:hover { color: #9b2b1a; }
.tdot { width: 8px; height: 8px; border-radius: 50%; background: #c4c2ba; display: inline-block; }
.tdot.st-running, .tdot.st-waiting { background: #2446a0; animation: pulse 1.6s ease-in-out infinite; }
.tdot.st-done { background: #22a447; }
.tdot.st-needs_review { background: #d99a00; }
.tdot.st-source_error, .tdot.st-error { background: #c0392b; }
.card.tabcard { border-top-left-radius: 0; }
/* usage tables: two per row, headers on one line, wide tables scroll inside their card */
.u-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.u-grid .card, #page-usage > .card { overflow-x: auto; }
#page-usage .tbl th { white-space: nowrap; }
#page-usage .tbl td { white-space: nowrap; }
#page-usage .tbl td:first-child { white-space: normal; min-width: 120px; }
@media (max-width: 900px) { .u-grid { grid-template-columns: minmax(0, 1fr); } }

.msg-list { max-height: 60vh; overflow-y: auto; }
.msg-item { padding: 10px 4px; border-bottom: 1px solid var(--soft, #eee); }
.msg-item.imp { background: #fff8e6; }
.msg-body { margin-top: 4px; white-space: normal; line-height: 1.5; }

/* Puni Hub additions */
.btn.danger { background: #b91c1c; color: #fff; border-color: #b91c1c; }
details.card > summary { cursor: pointer; }
.steps { margin: 0; padding-left: 20px; line-height: 1.9; }
.steps li.now { font-weight: 650; }
.steps li.now::after { content: attr(data-now); margin-left: 8px; font-size: 11px; font-weight: 600; background: #e3f4e6; color: #1d7a33; border-radius: 999px; padding: 1px 8px; }
.steps li.later { color: var(--mute); }
.pe-row td { background: #fafafa; }
