:root {
  --ink: #152424;
  --muted: #637270;
  --paper: #f3f5ef;
  --surface: #ffffff;
  --line: #d9dfd7;
  --teal: #0b7568;
  --teal-dark: #07584f;
  --mint: #bde9d7;
  --lime: #d9ef75;
  --danger: #a43a3a;
  --shadow: 0 22px 60px rgba(22, 48, 44, 0.1);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(217, 239, 117, .28), transparent 25rem),
    radial-gradient(circle at 92% 88%, rgba(189, 233, 215, .35), transparent 28rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
a { color: inherit; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 18px; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: var(--teal); font-weight: 800; }
.brand strong { color: var(--teal); }
.account { display: flex; align-items: center; gap: 14px; }
.account form { margin: 0; }
.account-name { color: var(--muted); font-size: 14px; }

.landing-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 156px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
  padding: 56px 0 84px;
}

.eyebrow { margin: 0 0 16px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero h1, .auth-card h1, .workspace-head h1 { margin: 0; letter-spacing: -.055em; line-height: .98; }
.hero h1 { max-width: 760px; font-size: clamp(52px, 7vw, 96px); }
.hero-copy { max-width: 660px; margin: 28px 0 0; color: var(--muted); font-size: clamp(18px, 2vw, 22px); line-height: 1.55; }
.hero-actions { margin-top: 34px; }

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(11, 117, 104, .24); outline-offset: 2px; }
.button-primary { color: white; background: var(--teal); box-shadow: 0 12px 26px rgba(11, 117, 104, .2); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { color: var(--teal-dark); border-color: #bad0ca; background: #eef7f3; }
.button-quiet { min-height: 38px; padding: 7px 13px; border-color: var(--line); background: rgba(255,255,255,.6); }
.button-danger { color: white; background: var(--danger); }
.button-wide { width: 100%; }
.button-small { min-height: 38px; padding: 7px 12px; font-size: 13px; }

.assurance-card {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  padding: 42px;
  border-radius: 34px;
  color: white;
  background: #123d39;
  box-shadow: var(--shadow);
}
.assurance-orbit { position: absolute; width: 330px; height: 330px; border: 1px solid rgba(217,239,117,.34); border-radius: 50%; top: -135px; right: -100px; }
.assurance-orbit::after { content: ""; position: absolute; inset: 54px; border: 1px solid rgba(189,233,215,.24); border-radius: inherit; }
.assurance-label { margin: 170px 0 12px; color: var(--lime); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.assurance-card h2 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
.assurance-card ul { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; color: #dcebe8; }
.assurance-card li { position: relative; padding-left: 22px; line-height: 1.45; }
.assurance-card li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.public-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 32px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.auth-shell { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 40px 20px 80px; }
.auth-card { width: min(460px, 100%); padding: clamp(28px, 5vw, 48px); border: 1px solid rgba(217,223,215,.9); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.auth-card h1 { font-size: 44px; }
.muted { color: var(--muted); line-height: 1.55; }
.stack-form { display: grid; gap: 18px; margin-top: 28px; }
label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 720; }
label small { color: var(--muted); font-weight: 500; }
input[type="text"], input[type="password"] { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #cdd6cf; border-radius: 11px; background: white; color: var(--ink); }
.back-link { display: inline-block; margin-top: 24px; color: var(--muted); font-size: 13px; text-decoration: none; }
.error-card .button { margin-top: 14px; }

.flash-stack { position: fixed; z-index: 20; right: 20px; top: 88px; width: min(380px, calc(100% - 40px)); display: grid; gap: 8px; }
.flash { padding: 13px 15px; border-radius: 12px; color: white; background: #243c39; box-shadow: 0 8px 26px rgba(0,0,0,.15); font-size: 14px; }
.flash-error { background: #8f3434; }
.flash-success { background: var(--teal); }

.workspace-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 44px 0 88px; }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.workspace-head h1 { font-size: clamp(44px, 6vw, 72px); }
.quota { width: min(340px, 100%); padding-bottom: 9px; }
.quota-copy { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.quota-copy span:first-child { color: var(--ink); font-weight: 750; }
.quota-track { display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 99px; background: #dce3dc; }
.quota-track::-webkit-progress-bar { border-radius: 99px; background: #dce3dc; }
.quota-track::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--teal), #34a58d); }
.quota-track::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--teal), #34a58d); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 20px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal); }
.action-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; margin-bottom: 20px; }
.action-card { display: flex; align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.72); }
.file-picker { flex: 1; min-width: 0; padding: 11px 13px; border: 1px dashed #9eb7af; border-radius: 12px; cursor: pointer; background: #f7faf8; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker-note { color: var(--muted); font-size: 11px; font-weight: 500; }
.folder-card label { flex: 1; }
.file-panel { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.84); box-shadow: 0 16px 46px rgba(30,50,47,.06); }
.file-panel-title { min-height: 66px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.file-panel-title h2 { margin: 0; font-size: 17px; }
.file-panel-title span { color: var(--muted); font-size: 12px; }
.file-list { display: grid; }
.file-row { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr) 44px; gap: 12px; align-items: center; min-height: 74px; padding: 10px 14px 10px 20px; border-bottom: 1px solid #e7ebe6; }
.file-row:last-child { border-bottom: 0; }
.file-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-weight: 900; }
.file-icon-folder { color: #715e12; background: #f2e9ad; }
.file-icon-file { color: var(--teal-dark); background: var(--mint); }
.file-main { min-width: 0; display: grid; gap: 4px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-weight: 750; }
.file-name:hover { color: var(--teal); }
.file-meta { color: var(--muted); font-size: 11px; }
.row-menu summary { list-style: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu[open] summary { background: #edf2ee; color: var(--ink); }
.row-menu-popover { position: absolute; z-index: 5; right: 14px; top: 57px; width: min(310px, calc(100% - 28px)); padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 16px 42px rgba(25,45,42,.16); }
.row-menu-popover form { display: grid; gap: 9px; }
.row-menu-popover form + form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.empty-state { min-height: 260px; display: grid; place-items: center; align-content: center; padding: 36px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 14px; border-radius: 18px; color: var(--teal); background: #e1f1e9; font-size: 28px; }
.empty-state h3 { margin: 0; color: var(--ink); }
.empty-state p { margin: 8px 0 0; }

@media (max-width: 820px) {
  .landing-shell { grid-template-columns: 1fr; padding-top: 32px; }
  .assurance-card { min-height: 360px; }
  .workspace-head { align-items: start; flex-direction: column; gap: 26px; }
  .quota { width: 100%; }
  .action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar, .landing-shell, .public-footer, .workspace-shell { width: min(100% - 24px, 1180px); }
  .account-name { display: none; }
  .hero h1 { font-size: 47px; }
  .assurance-card { min-height: 330px; padding: 28px; border-radius: 24px; }
  .assurance-label { margin-top: 140px; }
  .public-footer { gap: 12px; flex-direction: column; }
  .workspace-shell { padding-top: 28px; }
  .action-card { align-items: stretch; flex-direction: column; }
  .file-row { grid-template-columns: 38px minmax(0,1fr) 38px; padding-left: 13px; }
  .flash-stack { right: 12px; top: 78px; width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
