:root {
  --ink: #1c1916;
  --muted: #5e574e;
  --line: #ddd4c6;
  --paper: #f3eee6;
  --card: #fffdf9;
  --rail: #1b1e24;
  --seal: #9f2d22;
  --seal-dark: #7e2219;
  --danger: #8d2a22;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(159, 45, 34, 0.08), transparent 55%),
    var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

button, input { font: inherit; }

.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

h1, h2, .brand {
  font-family: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", serif;
  font-weight: 600;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.gate-card, .drop, .files li, .events li, .job {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.gate-card {
  width: min(420px, 100%);
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(40, 28, 16, 0.06);
}

.gate-card h1 {
  margin: 10px 0 8px;
  font-size: 40px;
  line-height: 1.2;
}

.section-head p, .lede, .aside-note, .drop-sub, #limit {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: block;
  margin: 22px 0 8px;
  font-size: 14px;
}

input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
}

button {
  border: 0;
  cursor: pointer;
}

.gate-card button, .ghost, .text-button, .file-actions button {
  border-radius: 999px;
}

.gate-card button, .gate-card a.enter {
  margin-top: 18px;
  width: 100%;
  padding: 12px 16px;
  background: var(--seal);
  color: white;
}

.gate-card a.enter {
  display: block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
}

.gate-card a.enter-alt {
  background: transparent;
  color: var(--seal);
  border: 1px solid var(--seal);
}

.gate-card button:hover, .file-actions button.danger:hover { background: var(--seal-dark); }

button:focus-visible, input:focus-visible, .drop:focus-within {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

.error {
  color: var(--danger);
  background: #fbeceb;
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.5;
}

.gate-card .error { margin: 12px 0 0; }

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

aside {
  background: var(--rail);
  color: #f6f1e8;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

aside .eyebrow { color: #b7aea2; }

.logo {
  display: block;
  width: 132px;
  height: auto;
  border-radius: 16px;
}

.gate-card .logo {
  width: 196px;
  margin: 0 auto 8px;
}

.aside-note, .space-name { margin: 0; color: #d9d0c4; line-height: 1.55; }

.aside-label {
  margin: 18px 0 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b7aea2;
}

code {
  display: block;
  word-break: break-all;
  font-size: 12px;
  line-height: 1.45;
  color: #f3eadf;
}

.text-button {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 14px;
  background: transparent;
  color: #f6f1e8;
  border: 1px solid rgba(246, 241, 232, 0.35);
}

main { padding: 36px 40px 64px; }

.mast {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.mast h1 { margin: 0 0 8px; font-size: 42px; }
#limit { margin: 0; max-width: 62ch; }

.ghost, .file-actions button {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.drop {
  margin-top: 22px;
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  border-style: dashed;
  position: relative;
  cursor: pointer;
}

.drop.over { background: #f8efe8; border-color: var(--seal); }

.drop-title { margin: 0; font-size: 22px; }
.drop-sub { margin: 6px 0 0; }

#picker, #notice-picker {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.jobs, .files, .events { list-style: none; margin: 0; padding: 0; }

.job, .files li, .events li {
  margin-top: 10px;
  padding: 14px 16px;
}

.bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 99px;
  background: #efe7dc;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--seal);
}

.job-state, .meta { color: var(--muted); font-size: 13px; }

h2 { margin: 28px 0 0; font-size: 28px; }

.section-head p { margin: 6px 0 0; }

.board {
  margin-top: 8px;
  padding: 8px 18px 18px;
  background: #fffaf4;
  border: 1px solid #eadfce;
  border-left: 4px solid var(--seal);
  border-radius: 18px;
}

.drop-compact { min-height: 112px; margin-top: 14px; }

.files li, .events li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.files li > div:first-child {
  flex: 1;
  min-width: 0;
}

.identity { min-width: 0; }

.file-name, .event-title {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.meta { margin: 4px 0 0; }

.file-actions { display: flex; gap: 8px; flex-shrink: 0; }
.file-actions button.danger { color: var(--danger); }

.empty { color: var(--muted); padding: 8px 0 0; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  aside {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
  }
  .logo { width: 56px; border-radius: 10px; }
  .aside-label { margin: 0; }
  .identity { flex: 1; }
  .text-button {
    margin-top: 0;
    flex-shrink: 0;
    min-height: 44px;
  }
  main {
    padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
  }
  .mast { align-items: flex-start; flex-direction: column; }
  .mast h1 { font-size: 28px; }
  .drop { min-height: 132px; margin-top: 14px; }
  .drop-title { font-size: 18px; }
  .files li, .events li { flex-direction: column; align-items: stretch; }
  .file-actions { width: 100%; }
  .file-actions button,
  .file-actions a {
    flex: 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }
}
