:root {
  --ink: #102a21;
  --ink-soft: #28483d;
  --paper: #f4f1e9;
  --paper-deep: #e9e4d8;
  --white: #fffdf8;
  --mint: #b9f4d2;
  --mint-strong: #49c987;
  --amber: #ffd58c;
  --violet: #d9c8ff;
  --rose: #ffc6bd;
  --line: rgba(16, 42, 33, 0.13);
  --shadow: 0 24px 70px rgba(21, 48, 38, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 85% 5%, rgba(185, 244, 210, 0.42), transparent 24rem),
    radial-gradient(circle at 0% 40%, rgba(255, 213, 140, 0.28), transparent 28rem),
    var(--paper);
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: var(--paper); }
.auth-art { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 44px clamp(34px, 6vw, 90px); overflow: hidden; background: var(--ink); color: var(--white); }
.auth-art::before, .auth-art::after { content: ""; position: absolute; border: 1px solid rgba(185,244,210,.18); border-radius: 50%; }
.auth-art::before { width: 560px; height: 560px; right: -230px; top: -150px; }
.auth-art::after { width: 350px; height: 350px; right: -80px; top: -20px; }
.auth-brand { position: relative; z-index: 1; color: white; }
.auth-brand .brand-mark { background: var(--mint); color: var(--ink); }
.auth-brand small { color: #9fb8ae; }
.auth-message { position: relative; z-index: 1; max-width: 680px; margin: auto 0; padding: 90px 0; }
.auth-message .eyebrow { color: var(--mint); }
.auth-message h1 { margin: 0; font: 500 clamp(48px, 5.5vw, 86px)/.98 Georgia, serif; letter-spacing: -.055em; }
.auth-message h1 em { color: var(--mint); font-weight: 400; }
.auth-message > p:last-child { max-width: 570px; margin-top: 28px; color: #aec4bb; font-size: 17px; line-height: 1.7; }
.auth-proof { position: relative; z-index: 1; color: #a9c0b6; font-size: 12px; letter-spacing: .04em; }
.auth-proof span { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--mint); color: var(--ink); font-weight: 900; }
.auth-panel { display: grid; place-items: center; padding: 44px; }
.auth-card { width: min(460px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,253,248,.9); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0; font: 38px/1.1 Georgia, serif; letter-spacing: -.035em; }
.auth-card > p:not(.eyebrow):not(.auth-error) { margin: 10px 0 24px; color: #6c8179; font-size: 13px; line-height: 1.55; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 13px; background: var(--paper-deep); }
.auth-tabs button { padding: 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: #6a7d76; font-size: 12px; font-weight: 800; }
.auth-tabs button.active { background: var(--white); color: var(--ink); box-shadow: 0 3px 12px rgba(16,42,33,.08); }
.auth-card form label, .settings-shell form label { margin: 16px 0 7px; }
.auth-card input:not([type=checkbox]), .settings-shell input:not([type=checkbox]) { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f2; color: var(--ink); outline: none; }
.auth-card .primary-button { margin-top: 22px; }
.auth-error { min-height: 20px; margin: 13px 0 0; color: #a23f35; font-size: 12px; }
.check-row { display: flex !important; align-items: flex-start; gap: 9px; cursor: pointer; font-weight: 600 !important; line-height: 1.4; }
.check-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--ink); }
.check-row[hidden] { display: none !important; }

.shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 32px; }

.topbar {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px 14px 14px 5px; background: var(--ink); color: var(--mint);
  font-family: Georgia, serif; font-size: 25px; font-style: italic;
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -0.02em; font-size: 17px; }
.brand small { margin-top: 2px; color: #668078; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.account-button { display: flex; flex-direction: column; align-items: flex-start; min-width: 112px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.46); cursor: pointer; }
.account-button span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.account-button small { color: #748981; font-size: 9px; text-transform: uppercase; }
.logout-button { font-size: 17px; }
.live-dot { display: flex; align-items: center; gap: 8px; color: #527066; font-size: 13px; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--mint-strong); box-shadow: 0 0 0 5px rgba(73,201,135,.13); }

.icon-button {
  width: 40px; height: 40px; border: 1px solid var(--line); background: rgba(255,255,255,.46);
  border-radius: 13px; cursor: pointer; font-size: 20px; transition: .2s ease;
}
.icon-button:hover { transform: translateY(-1px); background: var(--white); }

.hero { min-height: 380px; display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 30px; padding: 58px 4vw 42px; overflow: hidden; }
.eyebrow { margin: 0 0 12px; font-size: 11px; font-weight: 800; letter-spacing: .18em; color: #5e7d72; }
.hero h1 { margin: 0; max-width: 860px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(45px, 5.5vw, 82px); font-weight: 500; letter-spacing: -.055em; line-height: .98; }
.hero h1 span { color: #47886f; font-style: italic; }
.hero-copy { max-width: 680px; margin: 24px 0 0; color: #5d756d; font-size: 17px; line-height: 1.7; }
.hero-orbit { position: relative; width: 310px; height: 310px; justify-self: center; }
.center-orb { position: absolute; inset: 91px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--mint); font: italic 36px Georgia, serif; box-shadow: 0 20px 60px rgba(16,42,33,.24); }
.orbit { position: absolute; border: 1px solid rgba(16,42,33,.18); border-radius: 50%; }
.orbit-one { inset: 38px; }
.orbit-two { inset: 2px; border-style: dashed; animation: spin 32s linear infinite; }
.orbit-label { position: absolute; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,248,.86); box-shadow: 0 8px 24px rgba(16,42,33,.08); font-size: 12px; }
.label-one { top: 20px; left: 35px; }
.label-two { right: -5px; top: 142px; }
.label-three { left: -18px; bottom: 42px; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-strip { display: flex; align-items: center; gap: 14px; padding: 17px 20px; background: var(--ink); color: #effaf3; border-radius: 18px; box-shadow: var(--shadow); }
.status-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--mint); color: var(--ink); font-weight: 900; }
.status-strip strong, .status-strip span { display: block; }
.status-strip strong { font-size: 14px; }
.status-strip > div > span { margin-top: 3px; color: #acc1ba; font-size: 12px; }
.status-pills { margin-left: auto; display: flex; gap: 8px; }
.status-pills span { margin: 0; padding: 8px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #d4e3dd; font-size: 11px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 26px; }
.metric-card { position: relative; overflow: hidden; min-height: 142px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,253,248,.72); }
.metric-card::after { content: ""; position: absolute; width: 75px; height: 75px; border-radius: 50%; background: var(--paper-deep); right: -24px; bottom: -24px; }
.metric-card.accent-mint::after { background: var(--mint); }
.metric-card.accent-amber::after { background: var(--amber); }
.metric-card.accent-violet::after { background: var(--violet); }
.metric-card span, .metric-card small { display: block; color: #698078; }
.metric-card span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; margin: 12px 0 2px; font: 42px/1 Georgia, serif; }
.metric-card small { font-size: 12px; }

.workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.control-panel, .queue-panel { border: 1px solid var(--line); border-radius: 24px; background: rgba(255,253,248,.82); box-shadow: 0 16px 50px rgba(28,53,44,.07); }
.control-panel { padding: 24px; position: sticky; top: 18px; }
.panel-heading h2, .queue-header h2 { margin: 0; font: 30px/1.1 Georgia, serif; letter-spacing: -.025em; }
.panel-heading > p:last-child { color: #698078; line-height: 1.55; font-size: 13px; }
form label { display: block; margin: 22px 0 8px; font-size: 12px; font-weight: 800; }
textarea { width: 100%; resize: vertical; min-height: 132px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #faf8f2; color: var(--ink); outline: none; line-height: 1.55; }
textarea:focus, input:focus, select:focus { border-color: #56ac89; box-shadow: 0 0 0 3px rgba(86,172,137,.13); }
.quick-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.quick-examples button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: #61796f; cursor: pointer; font-size: 10px; }
.quick-examples button:hover { background: var(--paper-deep); color: var(--ink); }
.primary-button { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--ink); color: white; cursor: pointer; font-weight: 800; }
.primary-button:hover { background: #1b4637; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.primary-button b { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--ink); }
.safety-card { display: flex; gap: 11px; margin-top: 20px; padding: 14px; border-radius: 15px; background: #ecf8f0; }
.safety-shield { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--mint); font-weight: 900; }
.safety-card strong { font-size: 12px; }
.safety-card p { margin: 4px 0 0; color: #547066; font-size: 11px; line-height: 1.5; }

.queue-panel { min-height: 640px; overflow: hidden; }
.queue-header { display: flex; justify-content: space-between; gap: 18px; align-items: end; padding: 24px; border-bottom: 1px solid var(--line); }
.queue-tools { display: flex; gap: 8px; }
.search-box { display: flex; align-items: center; gap: 6px; min-width: 210px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f2; }
.search-box input { width: 100%; padding: 10px 0; border: 0; background: transparent; outline: none; font-size: 12px; }
select { padding: 10px 28px 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f2; color: var(--ink); font-size: 12px; }
.queue-list { padding: 6px 14px 16px; }
.queue-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px 10px; border-bottom: 1px solid var(--line); cursor: pointer; transition: .18s ease; }
.queue-item:hover { background: rgba(233,228,216,.42); transform: translateX(2px); }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px 14px 14px 5px; background: var(--paper-deep); color: var(--ink); font-weight: 900; }
.item-main { min-width: 0; }
.item-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.item-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.item-line time { margin-left: auto; color: #82948e; font-size: 10px; }
.comment-text { margin: 6px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #516a61; font-size: 13px; }
.item-meta { display: flex; gap: 7px; align-items: center; }
.tag { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.tag-engagement { background: #e8e2ff; color: #5e4d86; }
.tag-sales { background: #d9f5e5; color: #246342; }
.tag-human { background: #fff0d2; color: #7a511a; }
.tag-spam { background: #ffe3de; color: #8a3d32; }
.lead-score { color: #778b84; font-size: 10px; }
.item-action { padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: transparent; cursor: pointer; color: #526d63; font-size: 11px; font-weight: 750; }
.item-action:hover { background: var(--ink); color: white; }
.empty-state { padding: 80px 20px; text-align: center; color: #71867f; }
.empty-state div { font-size: 40px; }
.empty-state h3 { margin: 12px 0 6px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; }

footer { display: flex; justify-content: space-between; padding: 34px 2px 40px; color: #789087; font-size: 11px; }

dialog { width: min(680px, calc(100vw - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 24px; background: var(--white); color: var(--ink); box-shadow: 0 30px 120px rgba(5,20,15,.35); }
dialog::backdrop { background: rgba(9,27,20,.54); backdrop-filter: blur(7px); }
.dialog-shell { padding: 24px; }
.dialog-shell > header { display: flex; justify-content: space-between; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dialog-shell h2 { margin: 0; font: 30px Georgia, serif; }
.detail-section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-label { display: block; margin-bottom: 8px; color: #6e837b; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.customer-quote { margin: 0; padding: 16px; border-left: 3px solid var(--mint-strong); border-radius: 0 13px 13px 0; background: #f4f0e8; line-height: 1.55; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.analysis-box { padding: 13px; border: 1px solid var(--line); border-radius: 13px; }
.analysis-box small { display: block; color: #70877e; }
.analysis-box strong { display: block; margin-top: 4px; }
.reply-box { padding: 15px; border-radius: 14px; background: #eaf8ef; line-height: 1.55; }
.private-box { background: #eee9fb; }
.detail-note { color: #657b73; font-size: 12px; line-height: 1.55; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; }
.dialog-actions button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; }
.dialog-actions .approve { background: var(--ink); color: white; border-color: var(--ink); }
.dialog-actions .warn { background: var(--amber); }
.dialog-actions .danger { color: #8b4238; }
.settings-shell { width: min(980px, calc(100vw - 30px)); }
#settings-dialog { width: min(980px, calc(100vw - 30px)); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding-top: 22px; }
.settings-grid > section + section { padding-left: 30px; border-left: 1px solid var(--line); }
.settings-grid h3 { margin: 0 0 10px; font: 24px Georgia, serif; }
.settings-shell textarea { min-height: 95px; }
.compact-button { margin-top: 18px; }
.page-list { display: grid; gap: 7px; margin: 12px 0 18px; }
.page-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f2; }
.page-list strong, .page-list small { display: block; }
.page-list strong { font-size: 12px; }
.page-list small { margin-top: 3px; color: #7a8d86; font-size: 9px; }
.page-list article > span { padding: 5px 7px; border-radius: 999px; background: var(--amber); color: #6b481b; font-size: 9px; font-weight: 800; }
.page-list article > span.page-live { background: var(--mint); color: #225c3d; }
.settings-note { color: #71867f; font-size: 11px; line-height: 1.5; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; border-radius: 13px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .22s ease; font-size: 12px; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-art { min-height: 360px; }
  .auth-message { padding: 65px 0 45px; }
  .hero { grid-template-columns: 1fr; }
  .hero-orbit { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .control-panel { position: static; }
}

@media (max-width: 680px) {
  .auth-art { min-height: 300px; padding: 26px 22px; }
  .auth-message { padding: 42px 0 26px; }
  .auth-message h1 { font-size: 42px; }
  .auth-message > p:last-child { font-size: 13px; }
  .auth-panel { padding: 18px 14px 32px; }
  .auth-card { padding: 26px 20px; }
  .shell { padding: 0 15px; }
  .live-dot { display: none; }
  .account-button small, .logout-button { display: none; }
  .account-button { min-width: 0; }
  #workspace-switcher { max-width: 120px; }
  .hero { min-height: auto; padding: 46px 2px 34px; }
  .hero h1 { font-size: 44px; }
  .hero-copy { font-size: 14px; }
  .status-strip { align-items: flex-start; }
  .status-pills { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 126px; padding: 16px; }
  .metric-card strong { font-size: 35px; }
  .queue-header { display: block; }
  .queue-tools { margin-top: 16px; flex-direction: column; }
  .search-box { min-width: 0; }
  .queue-item { grid-template-columns: 40px minmax(0, 1fr); }
  .item-action { display: none; }
  .analysis-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > section + section { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  footer { display: block; line-height: 1.8; }
}
