:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #f0f5f3;
  --line: #d8ded9;
  --text: #1f2725;
  --muted: #64706c;
  --accent: #147c70;
  --accent-strong: #0f6258;
  --accent-soft: #dcefeb;
  --warn: #b46b15;
  --danger: #b23a35;
  --ok: #2f7d43;
  --shadow: 0 18px 48px rgba(31, 39, 37, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  padding: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  max-width: 1480px;
  height: calc(100vh - 36px);
  min-height: calc(100vh - 36px);
  margin: 0 auto;
}

.sidebar,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.brand h1,
.detail-header h2,
.history-head h2,
.section-title h3 {
  margin: 0;
}

.brand h1 {
  font-size: 25px;
  line-height: 1.2;
}

.workspace-identity {
  display: grid;
  gap: 3px;
  margin: 12px 22px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.workspace-identity strong {
  font-size: 13px;
}

.workspace-identity span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 8px;
  border-radius: 999px;
  background: #c2c9c5;
  box-shadow: 0 0 0 5px #eef1ef;
}

.status-dot.online {
  background: var(--ok);
}

.status-dot.error {
  background: var(--danger);
}

.capture-form {
  flex: 0 0 auto;
  display: grid;
  gap: 9px;
  padding: 12px 22px 14px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c9d1cc;
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--text);
  outline: none;
}

input {
  height: 38px;
  padding: 0 12px;
}

textarea {
  min-height: 62px;
  max-height: 96px;
  padding: 9px 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mode-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-height: 36px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f4;
}

.mode-button,
.tab {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.mode-button.active,
.tab.active {
  background: var(--panel);
  color: var(--accent-strong);
  box-shadow: 0 1px 6px rgba(31, 39, 37, 0.08);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
}

.primary-button,
.ghost-button,
.text-button {
  height: 38px;
  border-radius: 7px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: #aab4af;
  background: #aab4af;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.text-button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-strong);
}

.ghost-button.compact {
  width: auto;
  height: 34px;
  padding: 0 12px;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f4;
}

.view-button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.view-button.active {
  background: var(--panel);
  color: var(--accent-strong);
  box-shadow: 0 1px 6px rgba(31, 39, 37, 0.08);
}

.capture-only[hidden],
.author-panel[hidden],
.automation-panel[hidden] {
  display: none;
}

.history-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 10px;
}

.history-head h2 {
  font-size: 16px;
}

.history-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-search {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 0 14px 10px;
}

.history-search input,
.history-search select {
  height: 36px;
  font-size: 13px;
}

.history-list {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  max-height: none;
  padding: 0 14px 18px;
  overflow: visible;
}

.history-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 82px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.history-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.history-thumb {
  width: 54px;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e9eeeb;
  object-fit: cover;
}

.history-thumb.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.history-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-item strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-author {
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.history-tag {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1ef;
  color: #55615d;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-category {
  background: #f7ead5;
  color: #9b5e13;
}

.history-source {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.history-meta em {
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-menu {
  position: fixed;
  z-index: 20;
  min-width: 118px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(31, 39, 37, 0.16);
}

.context-menu button {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--danger);
  font-weight: 800;
  text-align: left;
}

.context-menu button:hover {
  background: #fff0ef;
}

.detail-panel {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 16px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.account-bar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-bar__status,
.account-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.space-badge,
.quota-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.space-badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.quota-badge {
  max-width: 260px;
  overflow: hidden;
  background: #f1f3f2;
  color: var(--muted);
  text-overflow: ellipsis;
}

.account-action,
.account-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.account-action {
  padding: 0 12px;
}

.account-action:hover,
.account-action.active {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 3px 10px 3px 4px;
}

.account-chip span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.account-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dialog {
  width: min(92vw, 460px);
  max-height: 92vh;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}

.auth-dialog::backdrop {
  background: rgba(20, 29, 27, 0.54);
  backdrop-filter: blur(5px);
}

.auth-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(14, 30, 26, 0.24);
}

.auth-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.auth-card__header h2 {
  margin: 0;
  font-size: 24px;
}

.auth-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 20px 0 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f4;
}

.auth-tabs button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--accent-strong);
  box-shadow: 0 1px 6px rgba(31, 39, 37, 0.08);
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form .primary-button {
  margin-top: 4px;
}

.auth-form small,
.invite-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.invite-help a {
  margin-left: 3px;
  color: var(--accent-strong);
  font-weight: 800;
}

.auth-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff0ef;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.auth-boundary {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e4bd78;
  border-radius: 7px;
  background: #fff7e8;
  color: #69420e;
  font-size: 14px;
  font-weight: 700;
}

.notice.error {
  border-color: #e0a29e;
  background: #fff0ef;
  color: var(--danger);
}

.notice.ok {
  border-color: #a9d7b7;
  background: #edf8f0;
  color: var(--ok);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-header .eyebrow {
  margin-bottom: 3px;
}

.detail-header h2 {
  max-width: 820px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.28;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef1ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ready {
  background: #e4f4e8;
  color: var(--ok);
}

.status-pill.failed {
  background: #ffecea;
  color: var(--danger);
}

.status-pill.partial {
  background: #fff2dc;
  color: var(--warn);
}

.status-pill.running,
.status-pill.downloading,
.status-pill.queued {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 0 10px;
}

.metric {
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.section-block {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.section-block.grow {
  flex: 1;
  min-height: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title h3 {
  font-size: 15px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.asset-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
  padding-right: 4px;
  overflow: visible;
}

.asset-list.empty {
  display: block;
  padding: 16px;
  border: 1px dashed #c8d0cb;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.repair-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid #e0a29e;
  border-radius: 8px;
  background: #fff7f6;
}

.repair-panel[hidden] {
  display: none;
}

.repair-panel div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.repair-panel strong {
  font-size: 14px;
}

.repair-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.asset-link {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.asset-link:hover {
  border-color: var(--accent);
}

.asset-link strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-link span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.asset-image-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-image-card:hover {
  border-color: var(--accent);
}

.asset-image-open {
  width: 100%;
  height: 112px;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #e9eeeb;
}

.asset-image-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-image-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-right: 46px;
}

.asset-image-meta strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-image-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.asset-quality {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 6px;
  border: 1px solid rgba(20, 90, 78, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
}

.asset-quality-preview {
  border-color: rgba(172, 93, 23, 0.24);
  color: #8a4a12;
}

.asset-copy-button {
  position: absolute;
  right: 8px;
  bottom: 7px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.asset-copy-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.image-preview[hidden] {
  display: none;
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 5vh 18px;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 22, 0.72);
}

.image-preview-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, 94vw);
  max-height: 90vh;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #101614;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.image-preview-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  background: #fff;
}

.image-preview-panel header strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.image-preview-actions button,
.image-preview-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.image-preview-actions button:hover,
.image-preview-actions a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.image-preview-panel img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 52px);
  margin: auto;
  object-fit: contain;
}

.text-box {
  max-height: none;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  line-height: 1.65;
  white-space: pre-wrap;
}

.muted {
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f4;
}

.tab {
  height: 30px;
}

.content-text {
  flex: 1;
  min-height: 380px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--text);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    "PingFang SC", monospace;
  font-size: 14px;
  line-height: 1.7;
  overflow: visible;
  white-space: pre-wrap;
}

.author-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.author-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.author-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.28;
}

.author-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px);
  gap: 12px;
  padding: 10px 0;
}

.author-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.author-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  gap: 14px;
  min-height: 220px;
}

.author-list,
.sample-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  padding-right: 4px;
  overflow: auto;
}

.author-list.empty,
.sample-list.empty {
  display: block;
  padding: 16px;
  border: 1px dashed #c8d0cb;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.author-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.author-item.active,
.author-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.author-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-item span,
.author-item em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-toolbar {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.check-line,
.sample-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.check-line input,
.sample-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.sample-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sample-check {
  min-width: 0;
}

.sample-check span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sample-check strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sample-check em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-open {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.sample-open:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.author-report-block {
  flex: 1;
  min-height: 0;
}

.author-report-text {
  min-height: 360px;
}

.automation-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.automation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 0;
}

.automation-stat {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.automation-stat span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.automation-stat strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.3;
}

.tracked-author-list {
  display: grid;
  gap: 8px;
}

.tracked-author-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tracked-author-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.tracked-author-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tracked-author-title strong {
  font-size: 15px;
  line-height: 1.25;
}

.tracked-author-title em {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.tracked-author-meta,
.tracked-author-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.tracked-author-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tracked-author-counts span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tracked-author-actions {
  display: flex;
  align-items: start;
  gap: 8px;
}

.tracked-author-actions a,
.tracked-author-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.tracked-author-actions a:hover,
.tracked-author-actions button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.automation-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.automation-flow div {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.automation-flow strong {
  font-size: 14px;
  line-height: 1.3;
}

.automation-flow span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 10px;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: auto;
  }

  .history-list {
    max-height: none;
  }

  .sidebar,
  .detail-panel {
    height: auto;
    min-height: 760px;
    overflow: visible;
  }

  .account-bar {
    grid-column: 1;
    grid-row: 1;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
  }

  .detail-panel {
    grid-column: 1;
    grid-row: 3;
  }

  .author-controls,
  .author-grid,
  .automation-summary,
  .automation-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    gap: 0;
  }

  .account-bar,
  .sidebar,
  .detail-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .detail-header,
  .summary-grid,
  .form-actions,
  .author-actions,
  .tabs,
  .tracked-author-card {
    grid-template-columns: 1fr;
  }

  .tracked-author-actions {
    flex-wrap: wrap;
  }

  .detail-header {
    display: grid;
  }

  .account-bar {
    display: grid;
  }

  .account-bar__status,
  .account-bar__actions {
    flex-wrap: wrap;
  }

  .quota-badge {
    max-width: 100%;
  }

  .summary-grid {
    display: grid;
  }

  .detail-panel,
  .brand,
  .capture-form {
    padding-right: 16px;
    padding-left: 16px;
  }

  .workspace-identity {
    margin-right: 16px;
    margin-left: 16px;
  }

  .detail-header h2 {
    font-size: 22px;
  }
}
