.workspace {
  display: grid;
  grid-template-columns: 230px 1fr;
  max-width: 1600px;
  margin: auto;
  min-height: calc(100vh - 100px);
}
aside {
  padding: 35px 22px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
aside h2 {
  font-size: 25px;
  letter-spacing: -1px;
}
aside .button {
  padding: 12px 18px;
}
#batch-list {
  display: grid;
  gap: 8px;
  margin: 25px 0;
}
.batch-item {
  text-align: left;
  padding: 13px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  color: var(--ink);
  width: 100%;
  overflow-wrap: anywhere;
}
.batch-item.active {
  border-color: var(--line);
  background: #e4ebde;
}
.batch-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}
.aside-bottom {
  margin-top: auto;
  font-size: 12px;
}
.aside-bottom small {
  color: var(--muted);
  line-height: 1.6;
  display: block;
}
.aside-bottom button {
  display: block;
  margin-top: 14px;
}
.workspace main {
  width: 100%;
  min-width: 0;
  padding: 40px;
}
.desk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.desk-header h1 {
  font-size: 40px;
  letter-spacing: -1.5px;
}
.local-notice {
  font-size: 12px;
  background: #e9eddf;
  padding: 15px;
  line-height: 1.7;
  color: var(--muted);
  border-radius: 4px;
}
#save-state {
  display: block;
  color: var(--green);
  font-weight: 600;
}
#empty-state {
  padding: 65px 15px;
}
#empty-state h2 {
  max-width: 540px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 30px 0;
}
.stats {
  display: flex;
  gap: 25px;
  font-size: 12px;
}
.stats strong {
  display: block;
  font-size: 27px;
  font-weight: 500;
}
.controls {
  display: flex;
  gap: 18px;
  align-items: end;
  flex-wrap: wrap;
  padding-bottom: 18px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
input,
select,
textarea {
  display: block;
  padding: 11px;
  border: 1px solid #bec9b8;
  border-radius: 4px;
  background: #fffefb;
  color: var(--ink);
  width: 100%;
  margin: 7px 0 0;
}
select {
  font-size: 12px;
}
.text-button {
  border: 0;
  background: none;
  padding: 8px 0;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 12px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  font:
    9px ui-monospace,
    monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 18px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  max-width: 250px;
  overflow-wrap: anywhere;
}
td small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
td img {
  width: 52px;
  height: 42px;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 7px;
}
.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.row-actions button {
  font-size: 11px;
  padding: 7px;
  border: 1px solid #bec9b8;
  background: transparent;
  border-radius: 3px;
  color: var(--green);
}
#message {
  padding: 15px 0;
  font-size: 13px;
}
#reddit-settings {
  padding: 20px;
  background: #eeeee4;
  border-radius: 5px;
  max-width: 650px;
}
.check {
  display: flex;
  align-items: start;
  gap: 9px;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 18px;
  font-weight: 400;
}
.check input {
  width: 18px;
  flex: none;
  margin-top: 2px;
}
#reddit-settings a {
  display: inline;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 1080px;
  width: 94vw;
  padding: 28px;
  background: var(--paper);
  color: var(--ink);
  max-height: 94vh;
  overflow: auto;
}
dialog::backdrop {
  background: #0d281cc2;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
}
.dialog-head h2 {
  font-size: 30px;
  margin: 10px 0 25px;
}
.icon-button {
  background: none;
  border: 0;
  font-size: 22px;
  align-self: start;
  padding: 10px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.fields > label,
.fields > .two,
.fields > details {
  margin-bottom: 15px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.upload-zone {
  border: 1px dashed #769d7c;
  padding: 28px 18px;
  border-radius: 6px;
  background: #edf1e6;
}
.upload-zone small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
}
.upload-zone input {
  border: 0;
  background: transparent;
  padding: 10px 0;
  font-size: 11px;
}
.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.photo-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #e6e9df;
}
.photo-card {
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 4px;
}
.photo-card button {
  font-size: 10px;
}
.photo-card select {
  font-size: 11px;
  padding: 6px;
}
#photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
#editor-blockers {
  color: #8b3e19;
}
details summary {
  cursor: pointer;
  font-size: 12px;
  padding: 8px 0;
}
#editor-message {
  color: #8b3e19;
}
.sample-badge {
  background: #eee4d5;
  color: #734812;
  font-size: 10px;
  padding: 4px;
  border-radius: 3px;
}
button.danger {
  color: #a02b17;
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 180px 1fr;
  }
  .workspace main {
    padding: 25px;
  }
  aside {
    padding: 25px 15px;
  }
  .desk-header {
    align-items: start;
  }
  .desk-header h1 {
    font-size: 32px;
  }
  .stats {
    gap: 15px;
  }
  .stats strong {
    font-size: 24px;
  }
}
@media (max-width: 720px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 5%;
  }
  aside h2,
  aside > .eyebrow {
    display: none;
  }
  #batch-list {
    display: flex;
    overflow: auto;
    margin: 15px 0 0;
  }
  .batch-item {
    min-width: 150px;
    width: auto;
  }
  .aside-bottom {
    margin-top: 15px;
  }
  .aside-bottom p {
    margin: 0;
  }
  .aside-bottom small {
    font-size: 10px;
  }
  .aside-bottom button {
    display: inline-block;
    margin-right: 20px;
  }
  .workspace main {
    padding: 25px 5%;
  }
  .desk-header {
    flex-wrap: wrap;
    gap: 0;
  }
  .desk-header h1 {
    font-size: 32px;
  }
  .desk-header > .button {
    margin-bottom: 20px;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .dialog-actions {
    position: sticky;
    bottom: -28px;
    background: var(--paper);
    padding-bottom: 15px;
  }
  dialog {
    padding: 20px;
  }
  .stats {
    font-size: 10px;
  }
  .controls {
    gap: 12px;
  }
  .controls label {
    flex: 1;
  }
  td {
    min-width: 100px;
  }
}
/* Comic identity, with a quieter reading surface for inventory work. */
.workspace {
  background: var(--paper);
}
.workspace aside {
  border-right: 2px solid var(--ink);
  background: #f0ecdf;
}
.workspace aside h2 {
  font-family: Bangers, Impact, sans-serif;
  font-size: 35px;
  letter-spacing: 0.5px;
}
.desk-header h1 {
  font-family: Bangers, Impact, sans-serif;
  font-size: 48px;
  letter-spacing: 0.5px;
}
.local-notice {
  background: #e6f5f2;
  border: 1.5px solid var(--ink);
  border-radius: 0;
}
.batch-item {
  border-radius: 0;
}
.batch-item.active {
  border: 1.5px solid var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
}
.stats strong {
  font-family: Bangers, Impact, sans-serif;
  font-size: 38px;
  letter-spacing: 0.5px;
}
.table-wrap {
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: #fffdf8;
}
th {
  background: var(--yellow);
  font:
    700 9px "DM Sans",
    sans-serif;
}
td {
  border-bottom: 1px solid #d4cfc2;
}
.row-actions button {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font-weight: 700;
  background: var(--paper);
}
.row-actions button:hover {
  background: var(--cyan);
}
.status {
  background: #c8efdb;
  border: 1px solid #23613b;
  border-radius: 0;
  color: #174128;
  font-size: 9px;
  font-weight: 700;
}
.status.amber {
  background: #fff0bf;
  color: #6a421b;
  border-color: #6a421b;
}
.text-button {
  color: var(--ink);
  font-weight: 700;
}
input,
select,
textarea {
  border: 1.5px solid #65606d;
  border-radius: 0;
}
input[type="checkbox"] {
  accent-color: #d9361c;
}
.check {
  font-weight: 400;
}
.upload-zone {
  border: 2px dashed var(--ink);
  border-radius: 0;
  background: #fff0bc;
}
.photo-card {
  border: 1.5px solid var(--ink);
  border-radius: 0;
}
.photo-card img {
  background: #eee9df;
}
dialog {
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 8px 8px 0 var(--ink);
}
.dialog-head h2 {
  font-family: Bangers, Impact, sans-serif;
  font-size: 40px;
}
.sample-badge {
  border: 1px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  border-radius: 0;
}
#reddit-settings {
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: #fff0bc;
}
#save-state {
  color: #154d32;
}
#message {
  font-weight: 700;
}
.dialog-actions .button {
  box-shadow: 3px 3px 0 var(--ink);
}
@media (max-width: 720px) {
  .workspace aside {
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }
  .desk-header h1 {
    font-size: 40px;
  }
  .stats strong {
    font-size: 32px;
  }
  .local-notice {
    font-size: 10px;
  }
  .controls .button {
    box-shadow: 2px 2px 0 var(--ink);
  }
}
/* Stealth mode keeps evidence, fields, and status labels legible. */
[data-theme="dark"] .workspace aside {
  background: #151b28;
  border-color: #46526b;
}
[data-theme="dark"] .batch-item {
  color: #d6dfef;
}
[data-theme="dark"] .batch-item.active {
  background: #302941;
  border-color: #9d8fc1;
  box-shadow: 3px 3px 0 #02040b;
}
[data-theme="dark"] .local-notice {
  background: #173039;
  color: #bfd5df;
  border-color: #526e7d;
}
[data-theme="dark"] #save-state {
  color: #97e2ca;
}
[data-theme="dark"] .table-wrap {
  background: #141b27;
  border-color: #52647b;
  box-shadow: 4px 4px 0 #02040b;
}
[data-theme="dark"] th {
  background: #25213a;
  color: #d4ccf7;
  border-color: #46526b;
}
[data-theme="dark"] td {
  border-color: #354158;
}
[data-theme="dark"] .row-actions button {
  background: #232b3d;
  color: #dce7fa;
  border-color: #697c98;
}
[data-theme="dark"] .row-actions button:hover {
  background: #31435a;
}
[data-theme="dark"] .status {
  background: #173a34;
  color: #b8efd8;
  border-color: #468971;
}
[data-theme="dark"] .status.amber {
  background: #403321;
  color: #ffddb1;
  border-color: #af8653;
}
[data-theme="dark"] .sample-badge {
  background: #29243f;
  color: #d2c7ff;
  border-color: #8473b0;
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #151c2a;
  color: #e5eaf6;
  border-color: #6b7b97;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #9aa8c0;
}
[data-theme="dark"] .upload-zone {
  background: #202b3d;
  border-color: #8193b1;
}
[data-theme="dark"] .photo-card {
  background: #151c2a;
  border-color: #60718c;
}
[data-theme="dark"] .photo-card img {
  background: #262e3d;
}
[data-theme="dark"] dialog {
  background: #101722;
  color: #e5eaf6;
  border-color: #6b7b97;
  box-shadow: 8px 8px 0 #02040b;
}
[data-theme="dark"] .dialog-actions {
  background: #101722;
  border-color: #46526b;
}
[data-theme="dark"] #reddit-settings {
  background: #29243c;
  border-color: #8d7aaf;
}
[data-theme="dark"] .text-button {
  color: #badce9;
}
[data-theme="dark"] .icon-button {
  color: #e5eaf6;
}
[data-theme="dark"] #editor-blockers,
[data-theme="dark"] #editor-message {
  color: #ffb998;
}
[data-theme="dark"] .dialog-actions .button {
  box-shadow: 3px 3px 0 #02040b;
}

/* Recoverable intake keeps every action available by keyboard and touch. */
.upload-zone.drag-active {
  background: var(--cyan);
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.upload-status {
  padding-left: 20px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.upload-status:empty {
  display: none;
}
.photo-toolbar,
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.photo-toolbar button,
.photo-card button {
  min-height: 40px;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.photo-card {
  min-width: 0;
}
.photo-card small {
  overflow-wrap: anywhere;
}
.photo-card > button {
  margin-top: 10px;
  width: 100%;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid #4d8eff;
  outline-offset: 3px;
}
.error-message,
#restore-message {
  color: #9b3719;
}
#restore-dialog {
  max-width: 680px;
  line-height: 1.6;
}
#restore-warning {
  padding: 14px;
  background: #fff0bc;
  color: #3f301a;
}
[data-theme="dark"] .error-message,
[data-theme="dark"] #restore-message {
  color: #ffb998;
}
[data-theme="dark"] .upload-zone.drag-active {
  background: #31435a;
}
[data-theme="dark"] #restore-warning {
  background: #403321;
  color: #ffddb1;
}
@media (max-width: 420px) {
  #photo-grid {
    grid-template-columns: 1fr;
  }
  .two {
    grid-template-columns: 1fr;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
  .dialog-actions .button {
    width: 100%;
  }
  dialog {
    padding: 16px;
    width: calc(100vw - 20px);
  }
}

#account-panel {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line, #ddd);
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
#account-panel p {
  flex-basis: 100%;
  margin: 0;
}
#account-panel form {
  display: flex;
  gap: 0.5rem;
  align-items: end;
  flex-wrap: wrap;
}
#account-panel form[hidden] {
  display: none;
}
#account-panel label {
  display: grid;
  gap: 0.3rem;
}
#private-status,
#retry-private {
  margin: 1rem 2rem;
}
.private-loading .workspace {
  visibility: hidden;
}
#draft-review {
  padding: 1rem;
  border: 1px solid var(--line, #ddd);
  margin-top: 1rem;
}
#draft-review img {
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
}
#draft-review .draft-review {padding:0; margin:0; max-width:none}
#draft-review .fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
#draft-review .fields label {display:grid;gap:.4rem}
#draft-review .fields input,#draft-review .fields select,#draft-review .fields textarea {width:100%;min-width:0;box-sizing:border-box}
#draft-review .draft-evidence {display:flex;gap:1rem;flex-wrap:wrap}
#draft-review .draft-evidence h4 {flex-basis:100%}
@media(max-width:640px){#draft-review .fields{grid-template-columns:1fr}#account-panel{padding:1rem}}

#draft-review .extraction-review{padding:1rem 0;margin:1rem 0;border-top:1px solid currentColor} #draft-review .suggestion{padding:1rem 0;border-bottom:1px solid var(--line,#ddd)} #draft-review .suggestion img{max-width:220px;max-height:180px} #draft-review .extraction-review button{margin:.5rem .5rem .5rem 0}

#grouping-dialog { width: min(720px, 94vw); max-height: 90vh; overflow: auto; }
#grouping-preview { display: grid; gap: 12px; }
.grouping-card { border: 1px solid var(--ink, #29262b); border-radius: 10px; padding: 12px 16px; }
.grouping-card h3 { margin: 0; }
.grouping-card li { overflow-wrap: anywhere; }
#batch-photo-drop { display:block; margin:18px 0; }

.grouping-card ul { list-style:none; padding:0; display:flex; flex-wrap:wrap; gap:14px; }
.grouping-card li { display:grid; max-width:150px; gap:5px; font-size:12px; }
#recovery-inbox { margin:20px auto; max-width:1100px; padding:20px; border:2px solid #29262b; background:var(--paper,#fff9ec); }
#recovery-inbox h2 { font-size:28px; margin:0 0 10px; }
#recovery-inbox button { padding:10px 14px; margin:10px 10px 0 0; }
.recovery-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:12px; }
.recovery-card { padding:14px; border:1px solid currentColor; overflow-wrap:anywhere; }
.recovery-card h3 { margin:0; font-size:22px; }
.recovery-card p { font-size:13px; line-height:1.5; }

/* Account actions share the comic workspace's type, ink and tactile feedback. */
#account-panel { padding-block:1.5rem; gap:1.1rem; background:var(--soft); align-items:flex-end; }
#account-panel .account-title { flex-basis:100%; margin:0; font-family:Bangers,sans-serif; font-size:clamp(1.6rem,3vw,2.2rem); font-weight:400; letter-spacing:.025em; }
#account-panel > p { flex:0 0 100%; max-width:none; color:var(--muted); line-height:1.5; }
#account-panel .auth-button { min-height:48px; padding:12px 20px; display:inline-flex; align-items:center; justify-content:center; gap:12px; border:2px solid var(--ink); border-radius:12px; box-shadow:3px 3px 0 var(--ink); font:700 .95rem/1.2 "DM Sans",sans-serif; cursor:pointer; transition:transform .15s,box-shadow .15s; }
#account-panel .auth-google { background:#fff; color:#1f1f1f; border-color:#747775; box-shadow:3px 3px 0 var(--ink); min-width:242px; }
#account-panel .auth-google img { flex:none; }
#account-panel .auth-email { background:var(--orange); color:#191724; }
#account-panel .auth-secondary { background:var(--paper); color:var(--ink); }
#account-panel .auth-button:hover:not(:disabled) { transform:translate(-1px,-1px); box-shadow:4px 4px 0 var(--ink); }
#account-panel .auth-button:active:not(:disabled) { transform:translate(2px,2px); box-shadow:1px 1px 0 var(--ink); }
#account-panel .auth-button:disabled { cursor:wait; opacity:.65; }
#account-panel .auth-button:focus-visible, #account-panel input:focus-visible { outline:3px solid var(--orange); outline-offset:5px; }
#account-panel label { font-size:.8rem; font-weight:700; }
#account-panel input { min-height:48px; padding:10px 14px; border:2px solid var(--ink); border-radius:10px; background:var(--paper); color:var(--ink); font:inherit; width:min(100%,280px); }
#account-panel form { gap:.75rem; }
@media(max-width:640px) { #account-panel .auth-button,#account-panel form,#account-panel label,#account-panel input { width:100%; } #account-panel .auth-google { min-width:0; } }
@media(prefers-reduced-motion:reduce) { #account-panel .auth-button { transition:none; } }
