:root {
  color-scheme: light;
  --ink: #102923;
  --ink-soft: #536b64;
  --paper: #f4f1e8;
  --card: #fffdf7;
  --line: #d8d7cb;
  --accent: #29d391;
  --accent-dark: #0d513d;
  --danger: #b83434;
  --shadow: 0 18px 55px rgba(25, 46, 39, 0.11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(41, 211, 145, 0.14), transparent 28rem),
    linear-gradient(135deg, #e8ece4 0%, var(--paper) 46%, #ece8dc 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 72px; }
.eyebrow, .step { margin: 0 0 8px; color: var(--accent-dark); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(34px, 5vw, 56px); line-height: .98; }
h2 { font-size: 24px; }
.lede { max-width: 420px; margin: 16px 0 30px; color: var(--ink-soft); font-size: 17px; line-height: 1.55; }

.login-panel {
  width: min(520px, 100%);
  margin: 8vh auto 0;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(16, 41, 35, .12);
  border-radius: 28px;
  background: rgba(255, 253, 247, .92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 34px; border-radius: 18px; background: var(--ink); color: var(--accent); font-weight: 900; letter-spacing: -.06em; }
.login-form { display: grid; gap: 18px; }
.login-form label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.login-form input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: #fff; color: var(--ink); }
.login-form input:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 4px rgba(41, 211, 145, .16); }
.form-error { min-height: 20px; margin: -6px 0 0; color: var(--danger); font-size: 14px; }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.account { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.status-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 13px 18px; border: 1px solid rgba(16, 41, 35, .12); border-radius: 14px; background: rgba(255,255,255,.54); color: var(--ink-soft); font-size: 13px; }
.status-strip > div:first-child { display: flex; align-items: center; gap: 8px; color: var(--accent-dark); font-weight: 800; }
.status-strip a { color: var(--ink); font-weight: 750; text-decoration: none; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(41, 211, 145, .15); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .8fr); gap: 22px; }
.card { border: 1px solid rgba(16, 41, 35, .12); border-radius: 22px; background: var(--card); box-shadow: 0 10px 35px rgba(25, 46, 39, .06); }
.publish-card, .current-card, .history-card { padding: 26px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.limit, .muted { color: var(--ink-soft); font-size: 13px; }

.drop-zone { display: grid; place-items: center; min-height: 250px; margin-top: 24px; padding: 28px; border: 1.5px dashed #9cafaa; border-radius: 18px; background: #f7f8f2; text-align: center; transition: .18s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent-dark); background: #edf8f0; transform: translateY(-1px); }
.drop-zone strong { margin: 14px 0 7px; font-size: 18px; }
.drop-zone span:last-child { color: var(--ink-soft); font-size: 14px; }
.upload-symbol { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--ink); color: var(--accent); font-size: 25px; }
.selected-file { align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 14px 16px; border-radius: 13px; background: #edf8f0; }
.selected-file:not([hidden]) { display: flex; }
.selected-file div { display: grid; gap: 3px; min-width: 0; }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file span { color: var(--ink-soft); font-size: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.safety-note { margin: 18px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.button { min-height: 42px; padding: 10px 16px; border: 0; border-radius: 11px; font-weight: 800; transition: .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { background: var(--ink); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button.quiet { background: transparent; color: var(--ink-soft); }
.button.full { width: 100%; }

.details { display: grid; gap: 2px; margin: 24px 0; }
.details div { display: grid; gap: 6px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--ink-soft); font-size: 12px; }
.details dd { margin: 0; font-weight: 750; overflow-wrap: anywhere; }
.details div:last-child dd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.history-card { margin-top: 22px; }
.history-list { display: grid; margin-top: 20px; }
.history-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.history-row strong { display: block; margin-bottom: 3px; font-size: 14px; }
.history-row span { color: var(--ink-soft); font-size: 12px; }
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty-state { margin: 16px 0 4px; color: var(--ink-soft); }

.preview-dialog { width: min(1180px, calc(100% - 24px)); height: min(860px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 20px; background: var(--card); box-shadow: 0 35px 100px rgba(0,0,0,.28); }
.preview-dialog::backdrop { background: rgba(8, 25, 21, .7); backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 14px; }
.preview-warning { margin: 0; padding: 0 24px 14px; color: var(--ink-soft); font-size: 12px; }
.preview-dialog iframe { width: 100%; height: calc(100% - 110px); border: 0; border-top: 1px solid var(--line); background: #fff; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(420px, calc(100% - 48px)); padding: 14px 18px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 820px) {
  .shell { padding-top: 28px; }
  .topbar { align-items: flex-start; }
  .workspace-grid { grid-template-columns: 1fr; }
  .status-strip { align-items: flex-start; flex-direction: column; }
  .history-row { grid-template-columns: 1fr auto; gap: 10px; }
  .history-row .hash { display: none; }
}

@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1180px); }
  .topbar { display: grid; }
  .card-heading { display: grid; }
  .publish-card, .current-card, .history-card { padding: 20px; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .history-row { grid-template-columns: 1fr; }
  .history-row .button { width: 100%; }
}

