:root {
  font-family: "Malgun Gothic", system-ui, sans-serif;
  color: #253c36;
  background: #f5f4ee;
  font-size: 15px;
  --green: #245a4e;
  --line: #ddded4;
  --muted: #718078;
  --paper: #fffef9;
  --gold: #c09246;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 10px 16px;
  color: inherit;
  font-weight: 600;
}
button:hover {
  background: #eef3ed;
  border-color: #88a396;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.danger {
  color: #a64a3e;
}
a {
  color: var(--green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #edf0e7;
  border-right: 1px solid var(--line);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.brand {
  font-size: 23px;
  letter-spacing: -1px;
  font-weight: 800;
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 400;
  margin: 10px 0;
  color: var(--muted);
}
.brand-icon {
  display: inline-block;
  font-size: 25px;
  margin-right: 9px;
}
.nav {
  display: grid;
  gap: 8px;
}
.nav button {
  text-align: left;
  border: 0;
  background: none;
  padding: 14px 16px;
  font-weight: 500;
}
.nav button.active {
  background: var(--green);
  color: #fff;
}
.side-note {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.main {
  padding: 28px 44px 60px;
  max-width: 1500px;
  width: 100%;
  margin: auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.topbar .actions {
  gap: 12px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 10px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 25px;
  gap: 18px;
}
h1 {
  font-size: 30px;
  letter-spacing: -1.4px;
  margin: 0 0 10px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.6px;
  margin: 0 0 15px;
}
h3 {
  font-size: 16px;
  margin: 0 0 12px;
}
p {
  line-height: 1.8;
}
p.sub {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 26px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 31px;
  margin-top: 12px;
  font-weight: 600;
}
.stat strong small {
  font-size: 13px;
  font-weight: 400;
  margin-left: 7px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 25px;
  margin: 18px 0;
}
.panel.soft {
  background: #edf2e9;
  border: 0;
}
.toolbar,
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar {
  margin-bottom: 20px;
}
.toolbar input {
  max-width: 260px;
}
.toolbar select {
  width: auto;
}
.toolbar .push {
  margin-left: auto;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
}
th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  padding: 14px 12px;
  background: #f5f6ef;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 12px;
  border-bottom: 1px solid #eeeee6;
  font-size: 13px;
}
td.title {
  font-weight: 600;
  max-width: 260px;
  white-space: normal;
}
td .meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}
.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 30px;
  font-size: 11px;
  background: #edf1e9;
  color: #54725e;
}
.badge.gold {
  background: #f5ecd8;
  color: #906b2d;
}
.badge.blue {
  background: #e9edf7;
  color: #526a92;
}
.badge.gray {
  background: #efefea;
  color: #7a8077;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: #456354;
  margin: 10px;
  font-size: 17px;
}
.empty .glyph {
  font-size: 35px;
  color: #96aa94;
}
.field {
  display: block;
  margin: 16px 0;
}
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 9px;
}
input,
select,
textarea {
  width: 100%;
  background: white;
  border: 1px solid #d5dcd1;
  border-radius: 8px;
  padding: 11px 12px;
  color: inherit;
}
textarea {
  resize: vertical;
  line-height: 1.9;
  min-height: 220px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 9px 0;
}
.notice {
  border-left: 3px solid var(--gold);
  padding: 12px 17px;
  background: #faf4e6;
  font-size: 13px;
  line-height: 1.8;
  margin: 18px 0;
}
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}
.switch input {
  width: 18px;
  height: 18px;
}
.checkline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.checkline input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.checkline p {
  margin: 4px 0;
  font-size: 12px;
  color: var(--muted);
}
del {
  color: #9d5b4c;
  background: #fae9e3;
}
ins {
  color: #246c4c;
  background: #e8f1dd;
  text-decoration: none;
}
.manuscript {
  white-space: pre-wrap;
  background: #fafaf3;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 2;
  font-family: serif;
  min-height: 200px;
  overflow-wrap: anywhere;
}
.count {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}
.count.over {
  color: #a36331;
}
.bars {
  display: grid;
  gap: 16px;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 7px;
}
.bar {
  height: 9px;
  border-radius: 20px;
  background: #ebeee4;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #7a9a80;
  width: var(--width);
}
progress {
  width: 100%;
  height: 10px;
  accent-color: #648a72;
}
.login-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}
.login-story {
  background: #214d43;
  color: #faf8ef;
  padding: 8vh 7vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-story .brand small {
  color: #b3c9bd;
}
.login-story h1 {
  font-family: serif;
  font-size: 48px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -2px;
}
.login-story p {
  color: #c3d3c9;
  font-size: 15px;
}
.book-art {
  margin: 30px 0;
  font-size: 110px;
  line-height: 1;
  color: #dfd9b5;
}
.login-form {
  align-self: center;
  padding: 60px;
  max-width: 550px;
  width: 100%;
  margin: auto;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin: 25px 0;
}
.tabs button {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 15px;
}
.tabs button.active {
  color: var(--green);
  border-bottom: 3px solid var(--green);
}
.login-form button.primary {
  width: 100%;
  margin: 15px 0;
}
.footer {
  font-size: 11px;
  letter-spacing: 1px;
  color: #a3bdb0;
}
.loading {
  padding: 30vh 20px;
  text-align: center;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #263f36;
  color: white;
  border-radius: 10px;
  padding: 14px 22px;
  max-width: 90vw;
  box-shadow: 0 8px 30px #0002;
  display: none;
  z-index: 10;
}
#toast.visible {
  display: block;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 30px;
  max-width: 540px;
  width: 90vw;
  background: var(--paper);
}
dialog::backdrop {
  background: #172c2666;
}
code {
  word-break: break-all;
  background: #edf1e7;
  padding: 10px;
  display: block;
}
.card-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.work-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 12px;
}
.work-card p {
  font-size: 13px;
  color: var(--muted);
}
.work-card .actions {
  margin-top: 20px;
}
.error {
  color: #a34232;
  font-size: 13px;
  line-height: 1.7;
}
.form-error {
  min-height: 20px;
}
.inline-link {
  font-size: 12px;
}
.settings-layout {
  max-width: 850px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}
.muted {
  color: var(--muted);
}
@media (max-width: 1000px) {
  .main {
    padding: 25px;
  }
  .sidebar {
    padding: 25px 15px;
  }
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 50px 35px;
  }
  .login-story h1 {
    font-size: 36px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    padding: 18px;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand small,
  .side-note {
    display: none;
  }
  .nav {
    display: flex;
    overflow: auto;
    gap: 2px;
  }
  .nav button {
    white-space: nowrap;
    padding: 10px;
    font-size: 12px;
  }
  .main {
    padding: 18px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  h1 {
    font-size: 25px;
  }
  .panel {
    padding: 18px;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 15px;
  }
  .login-wrap {
    display: block;
  }
  .login-story {
    padding: 25px;
  }
  .login-story h1 {
    font-size: 28px;
    margin-top: 35px;
  }
  .login-story p,
  .book-art,
  .footer {
    display: none;
  }
  .login-form {
    padding: 30px 25px;
  }
  .card-list {
    grid-template-columns: 1fr;
  }
  .topbar {
    font-size: 12px;
  }
  .grid2 {
    gap: 8px;
  }
}
.bulk-table { max-height: 360px; overflow: auto; scrollbar-gutter: stable; }
.batch-panel { margin: 20px 0; padding: 22px; border: 2px solid var(--green); background: #eef5ef; border-radius: 12px; }
.batch-panel h3 { display: flex; align-items: center; gap: 10px; }
.batch-panel progress { width: 100%; }
.batch-spinner { width: 20px; height: 20px; border: 3px solid #bdd3c5; border-top-color: var(--green); border-radius: 50%; animation: batch-spin 1s linear infinite; }
@keyframes batch-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .batch-spinner { animation: none; } }
