:root {
  --background: #f9f7f3;
  --bg-warm: #f2ede4;
  --border: #e8e2d6;
  --border-mid: #d9d2c2;
  --border-strong: #c8c0ae;
  --danger: #b42318;
  --foreground: #1c1916;
  --ink-2: #47423c;
  --muted: #7a7268;
  --muted-light: #b0a898;
  --primary: #d44b43;
  --primary-dark: #c3302c;
  --primary-paper: #ffefec;
  --primary-soft: #ffdfdb;
  --primary-line: #ffb5ab;
  --success: #23803b;
  --success-soft: #dbf3dd;
  --warning: #ce7c22;
  --warning-soft: #ffefda;
  --info: #0073ae;
  --surface: #fff;
  --surface-soft: #f5f2eb;
  --surface-3: #ede9e0;
  --ink-on-red: #fff9f5;
  --shadow-1: 0 1px 3px #150a080f, 0 1px 2px #150a080a;
  --shadow-2: 0 3px 8px #150a0814, 0 1px 3px #150a080a;
  --shadow-3: 0 8px 24px #150a081a, 0 2px 6px #150a080f;
  --shadow-modal: 0 28px 64px #150a082e, 0 8px 20px #150a081a;
  --system-display: "Songti SC", "STSong", "Source Han Serif SC", "PingFang SC", serif;
  --system-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, sans-serif;
  --system-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  font-family: var(--system-sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

textarea {
  resize: vertical;
}

.page-grid-bg {
  background: linear-gradient(90deg, #e8e2d63d 1px, transparent 1px),
    linear-gradient(180deg, #e8e2d62e 1px, transparent 1px), var(--background);
  background-size: 46px 46px, 46px 46px, auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 58px;
  padding: 0 28px;
  background: rgba(255, 254, 252, 0.92);
  border-bottom: 1px solid #ecd9d3;
  box-shadow: 0 1px 0 rgba(229, 202, 194, 0.45), 0 4px 20px rgba(21, 10, 8, 0.05);
  backdrop-filter: blur(12px);
}

.topbar-login {
  position: relative;
  padding: 0 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-width: 0;
  padding-right: 2px;
  font-weight: 700;
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(203, 39, 53, 0.18);
}

.topbar-login .brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.brand-text {
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.topbar-login .brand-text {
  font-size: 22px;
}

.brand-ai {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  color: white;
  background: #1b1714;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  color: #6d655c;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1;
}

.nav-links a svg {
  width: 14px;
  height: 14px;
}

.nav-links a.is-active {
  color: var(--primary);
  background: white;
  border-color: #f4e5de;
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.feedback-help-chip,
.points-nav-chip,
.topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid #eed5cc;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}

.feedback-help-chip {
  gap: 6px;
  padding: 0 11px;
  color: #5f4740;
  font-size: 13px;
  font-weight: 700;
}

.feedback-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  color: var(--primary);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-size: 12px;
}

.points-nav-chip {
  gap: 7px;
  min-width: 86px;
  padding: 0 12px;
}

.points-nav-coin {
  width: 18px;
  height: 18px;
  border: 4px solid #e9a130;
  border-radius: 50%;
  background: #fff2d0;
  box-shadow: inset 0 0 0 2px #fff8e5;
}

.points-nav-copy {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #5f554b;
  font-size: 12px;
  font-weight: 700;
}

.points-nav-value {
  color: #1d1814;
  font-family: var(--system-mono);
}

.topbar-avatar {
  width: 34px;
  padding: 0;
  color: #1d1814;
  font-weight: 800;
}

.app-shell,
.imagegen-page,
.video-transcript-page,
.auth-shell {
  min-height: 100vh;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 712px;
  padding: 57px 24px 26px;
}

.hero-copy {
  text-align: center;
  padding-top: 80px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 13px;
  color: var(--primary);
  background: rgba(255, 239, 236, 0.78);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
}

.eyebrow svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.hero h1,
.imagegen-hero h1,
.video-transcript-empty-hero h1,
.login-pitch h1 {
  margin: 0;
  color: var(--foreground);
  font-family: var(--system-display);
  font-weight: 400;
  letter-spacing: 0;
}

.hero h1 {
  margin-top: 26px;
  font-size: 46px;
  line-height: 1.24;
}

.hero-copy p,
.imagegen-hero p,
.video-transcript-empty-hero p {
  margin: 13px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.hero-copy strong {
  color: var(--foreground);
}

.link-box {
  width: min(760px, calc(100vw - 32px));
  margin-top: 40px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.link-box:focus-within,
.link-box.is-upload-mode {
  border-color: var(--primary-line);
  box-shadow: 0 0 0 4px rgba(212, 75, 67, 0.1), var(--shadow-3);
}

.tab-row {
  display: flex;
  gap: 22px;
  min-height: 31px;
  border-bottom: 1px solid var(--border);
}

.tab-row button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 0 3px 11px;
  color: var(--muted-light);
  font-weight: 750;
  white-space: nowrap;
}

.tab-row button svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.tab-row button.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tool-textarea,
.imagegen-input-card textarea,
.video-transcript-create-card textarea,
.login-code-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf9, var(--surface-soft));
  outline: none;
}

.tool-textarea {
  min-height: 96px;
  margin-top: 16px;
  padding: 16px;
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--ink-2);
  line-height: 1.7;
}

.tool-textarea:focus,
.imagegen-input-card textarea:focus,
.video-transcript-create-card textarea:focus,
.login-code-input:focus {
  border-color: var(--primary-line);
  box-shadow: 0 0 0 3px rgba(212, 75, 67, 0.12);
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
  margin-top: 10px;
}

.primary-button,
.secondary-button,
.ghost-button,
.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  border-radius: 9px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s, background 0.14s;
}

.primary-button svg,
.secondary-button svg,
.ghost-button svg,
.pill-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.primary-button {
  color: var(--ink-on-red);
  border: 1px solid #d4473f;
  background: linear-gradient(180deg, #e66b63, var(--primary-dark));
  box-shadow: 0 4px 18px rgba(185, 44, 35, 0.32), 0 1px 4px rgba(185, 44, 35, 0.16);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(185, 44, 35, 0.26);
}

.primary-button:disabled,
.imagegen-optimize-btn:disabled {
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.secondary-button,
.ghost-button,
.pill-button {
  color: #5f4f46;
  border: 1px solid #ead4ca;
  background: white;
}

.secondary-button:hover,
.ghost-button:hover,
.pill-button:hover {
  border-color: var(--primary-line);
  box-shadow: var(--shadow-2);
}

.input-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 12.5px;
}

.upload-panel {
  margin-top: 16px;
}

.upload-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.cookie-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid #91d7a1;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 270px;
  padding: 22px;
  border: 1px dashed var(--primary-line);
  border-radius: 10px;
  background: rgba(245, 242, 235, 0.72);
  text-align: center;
}

.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  color: var(--muted);
}

.drop-zone small {
  color: var(--muted-light);
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(420px, 100%);
  color: var(--muted-light);
}

.divider-text:before,
.divider-text:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.upload-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.upload-preview {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: cover;
}

.home-tool-strip {
  width: min(1080px, calc(100vw - 40px));
  margin: 0 auto;
  padding-bottom: 42px;
}

.home-tool-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  color: #1d1814;
}

.home-tool-head span {
  color: var(--muted-light);
  font-size: 12px;
}

.home-tool-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 132px;
  padding: 22px 28px;
  background: white;
  border: 1px solid #ead7cf;
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(45, 34, 20, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.home-tool-icon,
.video-transcript-empty-icon-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: linear-gradient(145deg, #ff8b86, #d7251f);
  box-shadow: 0 18px 34px rgba(210, 49, 41, 0.22);
}

.home-tool-icon {
  width: 84px;
  height: 84px;
  border-radius: 16px;
}

.home-tool-icon svg {
  width: 34px;
  height: 34px;
}

.home-tool-copy {
  display: grid;
  gap: 8px;
}

.home-tool-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-tool-title-row strong {
  font-size: 22px;
}

.home-tool-title-row em {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  color: var(--primary);
  background: var(--primary-paper);
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.home-tool-copy > span {
  color: var(--ink-2);
}

.home-tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-tool-tags small {
  color: var(--muted);
}

.rewrite-result-card,
.generated-panel,
.video-transcript-result-card,
.video-transcript-process-card {
  margin-top: 18px;
  background: linear-gradient(180deg, #fffffffa, #fffcf7f5), var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.rewrite-result-card {
  padding: 18px;
}

.rewrite-result-card h3,
.generated-panel h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.rewrite-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rewrite-box {
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rewrite-box strong {
  display: block;
  margin-bottom: 7px;
}

.rewrite-box p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.75;
}

.rewrite-summary {
  margin: -2px 0 14px;
  color: var(--ink-2);
  line-height: 1.7;
}

.rewrite-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  line-height: 1.75;
}

.rewrite-tags,
.rewrite-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rewrite-tags span,
.rewrite-meta small,
.generated-card-meta {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-2);
}

.rewrite-tags span {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.rewrite-meta small {
  padding: 5px 9px;
}

.rewrite-workbench-page {
  min-height: 100vh;
}

.rewrite-workbench-shell {
  width: min(1280px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.rewrite-workbench-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.rewrite-workbench-head h1 {
  margin: 8px 0 0;
  font-size: 30px;
  letter-spacing: 0;
}

.rewrite-task-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.rewrite-task-meta span {
  max-width: min(42vw, 270px);
  overflow: hidden;
  padding: 6px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.rewrite-workbench-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 278px;
  gap: 16px;
  align-items: start;
}

.rewrite-source-panel,
.rewrite-editor-panel,
.rewrite-publish-panel,
.rewrite-loading-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
}

.rewrite-source-panel,
.rewrite-editor-panel,
.rewrite-publish-panel {
  padding: 18px;
}

.rewrite-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rewrite-panel-title strong {
  font-size: 16px;
}

.rewrite-panel-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.rewrite-source-cover {
  display: grid;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rewrite-source-cover.is-grid {
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.rewrite-source-cover img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.rewrite-source-empty {
  display: grid;
  place-items: center;
  color: var(--muted-light);
}

.rewrite-source-empty svg {
  width: 46px;
  height: 46px;
}

.rewrite-source-panel h2 {
  margin: 14px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.rewrite-source-panel p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-2);
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.rewrite-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.rewrite-source-meta span,
.rewrite-source-meta a {
  padding: 5px 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.rewrite-source-meta a {
  color: var(--primary);
  font-weight: 700;
}

.rewrite-title-candidates {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.rewrite-title-candidates button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 13px;
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rewrite-title-candidates button.is-active {
  background: var(--primary-paper);
  border-color: var(--primary-line);
}

.rewrite-title-candidates small {
  color: var(--primary);
  font-weight: 800;
}

.rewrite-title-candidates span {
  line-height: 1.45;
}

.rewrite-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.rewrite-field span,
.rewrite-tag-editor > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rewrite-field input,
.rewrite-field textarea,
.rewrite-tag-input-row input {
  width: 100%;
  border: 1px solid var(--border);
  background: #fffdf9;
  border-radius: 10px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.rewrite-field input {
  min-height: 44px;
  padding: 0 13px;
  font-weight: 750;
}

.rewrite-field textarea {
  min-height: 300px;
  padding: 13px;
  line-height: 1.85;
}

.rewrite-field input:focus,
.rewrite-field textarea:focus,
.rewrite-tag-input-row input:focus {
  border-color: var(--primary-line);
  box-shadow: 0 0 0 3px rgba(212, 75, 67, 0.1);
}

.rewrite-tag-editor {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.rewrite-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rewrite-tag-list button {
  padding: 7px 10px;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.rewrite-tag-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.rewrite-tag-input-row input {
  min-height: 38px;
  padding: 0 12px;
}

.rewrite-check-list {
  display: grid;
  gap: 10px;
}

.rewrite-check-list div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rewrite-check-list span {
  color: var(--muted);
  font-size: 12px;
}

.rewrite-check-list strong {
  font-size: 14px;
}

.rewrite-action-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.rewrite-action-stack .primary-button,
.rewrite-action-stack .secondary-button,
.rewrite-action-stack .ghost-button {
  width: 100%;
}

.rewrite-loading-panel {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 28px;
  text-align: center;
}

.rewrite-loading-panel strong {
  margin-top: 12px;
  font-size: 18px;
}

.rewrite-loading-panel p {
  margin: 7px 0 16px;
  color: var(--muted);
}

.rewrite-loading-panel.is-error {
  color: var(--danger);
}

.rewrite-shell {
  min-height: 100vh;
}

.rewrite-status-panel {
  margin-bottom: 18px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
}

.rewrite-status-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.rewrite-status-chip,
.prompt-toggle-chip,
.log-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.rewrite-status-chip strong {
  color: var(--muted-light);
  font-weight: 900;
}

.rewrite-status-chip.is-done {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-line);
}

.rewrite-status-chip.is-done strong {
  color: var(--success);
}

.rewrite-status-chip.is-record {
  color: var(--primary);
  border-color: var(--success-line);
}

.rewrite-status-chip.is-record strong {
  color: var(--primary);
}

.rewrite-status-chip.is-running {
  color: var(--primary);
  background: rgba(255, 239, 236, 0.96);
  border-color: rgba(255, 106, 91, 0.48);
}

.rewrite-status-chip.is-running strong {
  color: var(--primary);
}

.rewrite-status-chip.is-error {
  color: var(--danger);
  background: rgba(255, 244, 242, 0.95);
  border-color: rgba(212, 75, 67, 0.35);
}

.rewrite-status-chip.is-error strong {
  color: var(--danger);
}

.rewrite-status-chip.is-image {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--border);
}

.rewrite-status-chip.is-image strong {
  color: var(--muted);
}

.rewrite-status-chip.is-image.is-running {
  color: var(--primary);
  background: rgba(255, 239, 236, 0.96);
  border-color: rgba(255, 106, 91, 0.48);
}

.rewrite-status-chip.is-image.is-running strong {
  color: var(--primary);
}

.rewrite-status-chip.is-image.is-done {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-line);
}

.rewrite-status-chip.is-image.is-done strong {
  color: var(--success);
}

.prompt-toggle-chip,
.log-toggle-chip {
  cursor: pointer;
}

.prompt-toggle-chip {
  margin-left: auto;
  color: var(--primary);
  background: rgba(255, 246, 242, 0.9);
  border-color: rgba(255, 106, 91, 0.42);
}

.prompt-toggle-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 999px;
}

.log-toggle-chip {
  color: var(--ink-2);
}

.rewrite-status-chip.is-saved-list {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.82);
}

.rewrite-log-panel {
  margin-top: 12px;
  padding: 12px;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
}

.rewrite-log-panel {
  display: grid;
  gap: 0;
  max-height: 276px;
  overflow: auto;
  padding: 0;
  background: rgba(255, 253, 249, 0.86);
}

.rewrite-log-row {
  display: grid;
  grid-template-columns: 76px 22px auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(229, 221, 209, 0.68);
}

.rewrite-log-row:last-child {
  border-bottom: 0;
}

.rewrite-log-time,
.rewrite-log-row small {
  color: var(--muted);
  font-size: 12px;
}

.rewrite-log-mark {
  color: var(--ink-2);
  font-weight: 900;
  text-align: center;
}

.rewrite-log-mark.is-ok {
  color: var(--success);
}

.rewrite-log-row strong {
  color: var(--ink-2);
  font-size: 13px;
}

.rewrite-log-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rewrite-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 390px);
  gap: 20px;
  align-items: start;
}

.rewrite-left-stack,
.rewrite-right-stack {
  display: grid;
  gap: 16px;
}

.rewrite-right-stack {
  position: sticky;
  top: 76px;
}

.rewrite-edit-card,
.rewrite-image-manager,
.rewrite-preview-card,
.rewrite-publish-actions {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
}

.rewrite-edit-card,
.rewrite-image-manager,
.rewrite-preview-card,
.rewrite-publish-actions {
  padding: 18px;
}

.rewrite-edit-field {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.rewrite-field-head,
.rewrite-image-head,
.rewrite-preview-head,
.rewrite-publish-actions header,
.note-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rewrite-field-head strong,
.rewrite-image-head strong,
.rewrite-preview-head strong,
.rewrite-publish-actions strong {
  color: var(--foreground);
  font-size: 16px;
}

.rewrite-field-head span,
.rewrite-image-head span,
.rewrite-preview-head span,
.rewrite-publish-actions p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.rewrite-field-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.field-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.field-ai-button,
.image-bulk-icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
}

.field-ai-button:disabled,
.image-section-ai-button:disabled,
.image-hover-generate:disabled,
.batch-generate-button:disabled {
  cursor: progress;
  opacity: 0.76;
}

.field-ai-button svg,
.image-bulk-icon-button svg {
  width: 15px;
  height: 15px;
}

.rewrite-edit-field input,
.rewrite-edit-field textarea,
.rewrite-chip-box input {
  width: 100%;
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

.rewrite-edit-field input {
  min-height: 48px;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 760;
}

.rewrite-edit-field textarea {
  min-height: 190px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.82;
}

.rewrite-edit-field input:focus,
.rewrite-edit-field textarea:focus,
.rewrite-chip-box input:focus {
  border-color: var(--primary-line);
  box-shadow: 0 0 0 3px rgba(212, 75, 67, 0.1);
}

.rewrite-tag-board {
  display: grid;
  gap: 10px;
}

.rewrite-chip-box {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px;
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.rewrite-chip-box .chip {
  min-height: 31px;
  padding: 0 11px;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.rewrite-chip-box input {
  flex: 1 1 120px;
  min-width: 110px;
  min-height: 31px;
  padding: 0 10px;
}

.rewrite-image-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.rewrite-image-head > div:first-child {
  display: grid;
  gap: 4px;
}

.rewrite-image-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rewrite-image-actions > span,
.image-bulk-text-button {
  min-height: 30px;
  padding: 0 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.image-bulk-text-button {
  color: var(--foreground);
  cursor: pointer;
}

.rewrite-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
}

.image-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
}

.image-card.is-selected {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(35, 128, 59, 0.12), var(--shadow-2);
}

.image-card.is-generating {
  border-color: rgba(248, 80, 78, 0.55);
}

.image-preview-hitarea {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--surface-soft);
  border: 0;
}

.image-preview-hitarea img,
.note-cover img,
.xhs-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-hitarea img {
  transition: filter 0.18s ease, transform 0.18s ease;
}

.image-index {
  position: absolute;
  top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 25px;
  color: white;
  background: rgba(28, 25, 22, 0.72);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.image-index {
  right: 8px;
}

.image-hover-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(25, 20, 18, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.image-card:hover .image-hover-overlay,
.image-card:focus-within .image-hover-overlay,
.image-card.is-selected .image-hover-overlay,
.image-card.is-generated .image-hover-overlay,
.image-card.is-generating .image-hover-overlay {
  opacity: 1;
  pointer-events: auto;
}

.image-card:hover .image-preview-hitarea img,
.image-card:focus-within .image-preview-hitarea img,
.image-card.is-selected .image-preview-hitarea img,
.image-card.is-generated .image-preview-hitarea img,
.image-card.is-generating .image-preview-hitarea img {
  filter: brightness(0.72);
  transform: scale(1.01);
}

.image-hover-top {
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-select-box,
.image-hover-round,
.image-hover-generate {
  border: 0;
  cursor: pointer;
}

.image-select-box {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--primary);
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 7px;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(20, 16, 12, 0.18);
}

.image-select-box.is-checked {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

.image-hover-round {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: white;
  background: rgba(32, 26, 24, 0.8);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(20, 16, 12, 0.22);
}

.image-hover-round svg {
  width: 15px;
  height: 15px;
}

.image-hover-round.is-danger {
  margin-left: auto;
  background: var(--primary);
}

.image-hover-generate {
  min-height: 34px;
  padding: 0 15px;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  box-shadow: 0 12px 24px rgba(248, 80, 78, 0.28);
  font-size: 13px;
  font-weight: 900;
}

.image-card footer {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
}

.image-card footer button {
  border: 0;
  cursor: pointer;
}

.image-card footer strong {
  color: var(--muted);
  font-size: 12px;
}

.image-footer-generate {
  min-width: 64px;
  min-height: 28px;
  padding: 0 10px;
  color: var(--primary);
  background: #fff6f3;
  border: 1px solid rgba(248, 80, 78, 0.2) !important;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.image-footer-generate:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.image-drag-handle {
  color: var(--muted-light);
}

.image-upload-card {
  display: grid;
  place-items: center;
  min-height: 206px;
  padding: 16px;
  color: var(--muted);
  border-style: dashed;
  cursor: pointer;
}

.image-upload-card strong {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--primary);
  border: 1px dashed var(--primary-line);
  border-radius: 999px;
  font-size: 24px;
}

.image-upload-card span {
  color: var(--foreground);
  font-weight: 900;
}

.image-upload-card small,
.image-upload-card em {
  font-size: 12px;
  font-style: normal;
}

.rewrite-generation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 16px;
}

.rewrite-preview-head {
  margin-bottom: 14px;
}

.rewrite-preview-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.rewrite-preview-head strong {
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}

.xhs-preview-phone {
  overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.xhs-preview-image {
  aspect-ratio: 3 / 4;
  background: var(--surface-soft);
}

.xhs-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 4px;
}

.xhs-carousel-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  background: var(--border);
  border: 0;
  border-radius: 999px;
}

.xhs-carousel-dots button.active {
  width: 24px;
  background: var(--primary);
}

.xhs-preview-content {
  padding: 12px 16px 10px;
}

.xhs-preview-content h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.35;
}

.xhs-preview-content p {
  margin: 0 0 7px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.75;
}

.xhs-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin-top: 10px;
}

.xhs-preview-tags span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
}

.xhs-preview-meta {
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 12px;
}

.xhs-preview-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
}

.xhs-preview-footer span {
  min-height: 34px;
  padding: 8px 12px;
  color: var(--muted-light);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 13px;
}

.xhs-preview-footer button {
  color: var(--ink-2);
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.rewrite-publish-actions {
  display: grid;
  gap: 11px;
}

.rewrite-publish-actions header span {
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.rewrite-publish-actions header span.is-saved {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-line);
}

.rewrite-publish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.is-primary-soft {
  color: var(--primary);
  background: var(--primary-paper);
  border-color: var(--primary-line);
}

.notes-page {
  min-height: 100vh;
}

.notes-shell {
  width: min(1510px, calc(100vw - 64px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.notes-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.notes-head h1 {
  margin: 8px 0 0;
  font-family: var(--system-display);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0;
}

.notes-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.notes-search {
  position: relative;
  flex: 0 0 min(360px, 38vw);
  display: flex;
  align-items: center;
}

.notes-search span {
  position: absolute;
  left: 16px;
  color: var(--muted-light);
  font-weight: 800;
}

.notes-search input {
  width: 100%;
  height: 50px;
  padding: 0 18px 0 44px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #ead9d0;
  border-radius: 13px;
  box-shadow: var(--shadow-2);
  outline: none;
}

.notes-search input:focus {
  border-color: var(--primary-line);
  box-shadow: 0 0 0 3px rgba(212, 75, 67, 0.12), var(--shadow-2);
}

.notes-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.notes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.notes-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ead9d0;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  font-weight: 800;
}

.notes-filter-chip span {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.notes-filter-chip b {
  color: inherit;
  font-size: 12px;
}

.notes-filter-chip.is-active {
  color: #fff;
  background: var(--foreground);
  border-color: var(--foreground);
}

.notes-toolbar-actions {
  display: flex;
  flex: none;
  gap: 9px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px;
}

.note-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 10px;
  text-align: left;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ead9d0;
  border-radius: 10px;
  box-shadow: var(--shadow-2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.note-card:hover,
.note-card:focus-visible {
  border-color: var(--primary-line);
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
  outline: none;
}

.note-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212, 75, 67, 0.12), var(--shadow-3);
}

.note-card-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f5f0e8;
  border: 1px solid #efe2d8;
  border-radius: 6px;
}

.note-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fffaf4;
}

.note-cover-empty {
  color: var(--muted-light);
}

.note-ai-badge,
.note-image-count {
  position: absolute;
  top: 9px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.note-ai-badge {
  left: 9px;
  color: #fff;
  background: rgba(22, 22, 22, 0.78);
}

.note-image-count {
  right: 9px;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.92);
}

.note-select-control {
  position: absolute;
  left: 9px;
  bottom: 9px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: rgba(24, 22, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  font-weight: 900;
}

.note-select-control.is-checked {
  background: var(--primary);
}

.note-card-body {
  display: grid;
  gap: 10px;
  padding: 14px 7px 8px;
}

.note-card-body h2 {
  display: -webkit-box;
  min-height: 44px;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.38;
  letter-spacing: 0;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.note-card-body p {
  display: -webkit-box;
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.note-card-body footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.note-card-body time {
  flex: none;
  color: var(--muted-light);
  font-size: 13px;
}

.note-status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 128px;
  min-height: 24px;
  padding: 0 9px;
  overflow: hidden;
  color: var(--success);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--success-soft);
  border: 1px solid var(--success-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.note-status-pill.synced,
.note-status-pill.qr {
  color: var(--info);
  background: #e7f4fb;
  border-color: #b9dff0;
}

.note-status-pill.failed {
  color: var(--danger);
  background: #fff0ee;
  border-color: #ffc4bd;
}

.note-status-pill.generating {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #ffd39a;
}

.notes-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 330px;
  padding: 36px;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
}

.notes-empty strong {
  font-size: 18px;
}

.notes-empty p {
  margin: 0;
  color: var(--muted);
}

.note-detail-backdrop {
  justify-content: flex-end;
  padding: 68px 30px 12px;
  background: rgba(28, 25, 22, 0.34);
  backdrop-filter: blur(5px);
}

.note-detail-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(840px, calc(100vw - 64px));
  max-height: calc(100vh - 82px);
  overflow: hidden;
  background: rgba(255, 254, 252, 0.98);
  border: 1px solid #ead9d0;
  border-radius: 0;
  box-shadow: var(--shadow-modal);
}

.note-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.note-detail-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-detail-close {
  flex: none;
}

.note-detail-scroll {
  min-height: 0;
  overflow: auto;
  padding-bottom: 18px;
}

.note-detail-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(560px, 58vh);
  height: auto;
  overflow: hidden;
  background: #f4f0e9;
}

.note-detail-hero img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(620px, 58vh);
  object-fit: contain;
}

.note-detail-empty {
  color: var(--muted-light);
}

.note-detail-count {
  position: absolute;
  top: 15px;
  right: 18px;
  min-width: 58px;
  padding: 6px 10px;
  color: #fff;
  text-align: center;
  background: rgba(28, 25, 22, 0.66);
  border-radius: 999px;
  font-weight: 900;
}

.note-detail-dots {
  position: absolute;
  bottom: 17px;
  left: 50%;
  display: flex;
  gap: 7px;
  transform: translateX(-50%);
}

.note-detail-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.78);
  border: 0;
  border-radius: 999px;
}

.note-detail-dots button.is-active {
  width: 24px;
  background: #fff;
}

.note-detail-thumbs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.note-detail-thumbs button {
  flex: 0 0 64px;
  height: 74px;
  overflow: hidden;
  padding: 3px;
  background: #fff;
  border: 1px solid #ead9d0;
  border-radius: 7px;
}

.note-detail-thumbs button.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(212, 75, 67, 0.18);
}

.note-detail-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fffaf4;
  border-radius: 4px;
}

.note-detail-copy {
  padding: 18px 22px 90px;
}

.note-detail-copy h3 {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: 0;
}

.note-detail-copy p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.9;
}

.note-detail-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(255, 254, 252, 0.9), #fff);
  border-top: 1px solid var(--border);
}

.note-detail-footer button {
  justify-content: center;
  min-height: 50px;
  border-radius: 9px;
  font-weight: 900;
}

.publish-qr-modal {
  max-width: 430px;
}

.publish-qr-box {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 22px 24px;
}

.publish-qr-real {
  display: grid;
  place-items: center;
  width: 188px;
  height: 188px;
  padding: 8px;
  background: white;
  outline: 1px solid var(--border);
  border-radius: 8px;
}

.publish-qr-real svg {
  display: block;
  width: 100%;
  height: 100%;
}

.publish-qr-loading,
.publish-qr-error {
  display: grid;
  min-height: 188px;
  place-items: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--muted);
}

.publish-qr-loading p,
.publish-qr-error p {
  margin: 0;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.publish-qr-error strong {
  color: var(--primary);
}

.publish-qr-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted);
}

.publish-qr-link span {
  overflow: hidden;
  align-self: center;
  color: var(--muted-foreground);
  font-family: var(--system-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-qr-link button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--foreground);
  background: white;
  font-weight: 900;
}

.imagegen-page {
  background: linear-gradient(90deg, #e8e2d63d 1px, transparent 1px),
    linear-gradient(180deg, #e8e2d62e 1px, transparent 1px), var(--background);
  background-size: 46px 46px, 46px 46px, auto;
}

.imagegen-first-screen {
  display: flex;
  min-height: calc(100vh - 256px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vh, 48px) 0;
}

.imagegen-hero {
  text-align: center;
  padding: 0 clamp(16px, 5vw, 80px) 56px;
}

.imagegen-hero h1 {
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.25;
}

.imagegen-input-card {
  width: min(720px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-2);
}

.imagegen-input-card textarea {
  min-height: 118px;
  padding: 14px;
  background: var(--surface-soft);
  border-color: transparent;
  line-height: 1.7;
}

.imagegen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.imagegen-inline-controls,
.imagegen-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.imagegen-inline-controls span {
  color: var(--muted);
  font-size: 12.5px;
}

.seg-button,
.ratio-select-trigger,
.imagegen-ref-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 0 12px;
  color: #5a5048;
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-1);
  font-weight: 750;
  white-space: nowrap;
}

.seg-button svg,
.ratio-select-trigger svg,
.imagegen-ref-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.seg-button.is-active {
  border-color: #ead4ca;
  background: #fffaf7;
  color: #1e1a16;
}

.ratio-select {
  position: relative;
}

.ratio-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 148px;
  padding: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-3);
}

.ratio-select-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 9px 10px;
  color: var(--ink-2);
  font-size: 13px;
}

.ratio-select-menu button:hover,
.ratio-select-menu button.is-active {
  color: var(--primary);
  background: var(--primary-paper);
}

.imagegen-optimize-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  color: #9d8e83;
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.imagegen-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 17px;
  color: white;
  background: linear-gradient(180deg, #e77169, var(--primary-dark));
  border: 1px solid var(--primary);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(185, 44, 35, 0.22);
  font-weight: 800;
  white-space: nowrap;
}

.imagegen-optimize-btn svg,
.imagegen-primary svg,
.imagegen-template-sort svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.imagegen-ref-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.imagegen-ref-thumb {
  position: relative;
  width: 54px;
  height: 48px;
  object-fit: cover;
  border: 1.5px solid var(--border);
  border-radius: 7px;
}

.imagegen-section {
  width: min(1300px, calc(100vw - 64px));
  margin: 0 auto;
  padding: 58px 0 70px;
}

.imagegen-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.imagegen-section-head strong {
  font-size: 15px;
}

.imagegen-section-head span {
  margin-left: 10px;
  color: var(--muted-light);
  font-size: 13px;
}

.imagegen-template-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  color: #5c5148;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}

.imagegen-template-sort strong {
  font-size: 12.5px;
}

.imagegen-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.imagegen-template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 420px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-2);
}

.imagegen-template-card:hover,
.imagegen-template-card.is-selected {
  border-color: var(--primary-line);
  box-shadow: 0 0 0 3px rgba(212, 75, 67, 0.08), var(--shadow-3);
}

.imagegen-template-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--ig-bg, #ddd9d0);
  overflow: hidden;
}

.imagegen-template-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imagegen-template-text-cover {
  display: grid;
  place-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  color: #6d5e55;
  background: repeating-linear-gradient(45deg, #eadfe5 0 10px, #f3edf0 10px 20px);
}

.imagegen-template-text-cover i {
  display: inline-flex;
  justify-content: center;
  min-width: 46px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.78);
  font-style: normal;
  font-weight: 800;
}

.imagegen-template-empty-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 12px;
}

.imagegen-template-card strong {
  padding: 13px 14px 0;
  font-size: 14px;
}

.imagegen-template-card p {
  display: -webkit-box;
  margin: 6px 14px 16px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.imagegen-template-new {
  display: grid;
  place-items: center;
  min-height: 420px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed var(--border-mid);
  border-radius: 10px;
}

.new-template-inner {
  display: grid;
  gap: 10px;
  place-items: center;
}

.new-template-plus {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--primary-line);
  border-radius: 50%;
  font-size: 25px;
}

.generated-panel {
  width: min(1000px, calc(100vw - 48px));
  margin: 18px auto 0;
  padding: 18px;
}

.generated-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.generated-card {
  overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-1);
}

.generated-card img,
.generated-card .generated-skeleton {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.generated-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 9px 9px 0;
  padding: 5px 8px;
  font-size: 12px;
}

.generated-skeleton {
  background: linear-gradient(90deg, #eee7dd, #fff, #eee7dd);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite;
}

.generated-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
}

.video-transcript-page {
  background: linear-gradient(90deg, #e8e2d63d 1px, transparent 1px),
    linear-gradient(180deg, #e8e2d62e 1px, transparent 1px), var(--background);
  background-size: 46px 46px, 46px 46px, auto;
}

.video-transcript-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
}

.video-transcript-sidebar {
  background: rgba(255, 255, 255, 0.78);
  border-right: 1px solid var(--border);
}

.video-transcript-sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.video-transcript-sidebar-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: white;
  background: linear-gradient(145deg, #f28f86, var(--primary-dark));
  border-radius: 9px;
}

.video-transcript-sidebar-icon svg {
  width: 17px;
  height: 17px;
}

.video-transcript-sidebar-head strong,
.video-transcript-sidebar-head em {
  display: block;
}

.video-transcript-sidebar-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.video-transcript-sidebar-action {
  padding: 14px 12px 8px;
}

.video-transcript-new {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid #ead7cf;
  border-radius: 8px;
  background: #fffdfa;
  font-weight: 800;
  white-space: nowrap;
}

.video-transcript-new svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.video-transcript-sidebar-meta {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.video-transcript-history {
  padding: 0 10px;
}

.video-transcript-empty-list {
  padding: 40px 18px 24px;
  text-align: center;
}

.video-transcript-empty-list strong {
  display: block;
  margin-bottom: 10px;
}

.video-transcript-empty-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.history-item {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}

.history-item strong {
  font-size: 13px;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
}

.video-transcript-main {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding: 42px;
  background: radial-gradient(circle at 66% 6%, rgba(212, 75, 67, 0.11), transparent 24%);
}

.video-transcript-empty-state {
  width: min(620px, 100%);
  text-align: center;
}

.video-transcript-empty-icon {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 22px;
}

.video-transcript-empty-icon-panel {
  width: 64px;
  height: 64px;
  border-radius: 17px;
}

.video-transcript-empty-icon-panel svg {
  width: 34px;
  height: 34px;
}

.video-transcript-empty-hero h1 {
  font-size: 30px;
  line-height: 1.3;
}

.video-transcript-create-card {
  margin-top: 28px;
  padding: 20px;
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-2);
}

.video-transcript-create-head,
.video-transcript-create-foot,
.video-transcript-result-toolbar,
.video-transcript-result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.video-transcript-create-head span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.video-transcript-create-card textarea {
  min-height: 146px;
  margin-top: 14px;
  padding: 15px;
  font-family: var(--system-mono);
  line-height: 1.8;
}

.video-transcript-create-foot {
  margin-top: 13px;
}

.video-transcript-cookie-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  min-height: 36px;
  color: var(--warning);
  border: 1px solid #f0bf84;
  border-radius: 8px;
  background: var(--warning-soft);
  font-size: 12.5px;
}

.video-transcript-cookie-hint svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.video-transcript-process-card {
  padding: 24px;
  text-align: left;
}

.video-transcript-process-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.video-transcript-live-dot {
  width: 9px;
  height: 9px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(212, 75, 67, 0.12);
  animation: pulse 1.1s ease-in-out infinite;
}

.process-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4e7df;
}

.process-meter span {
  display: block;
  height: 100%;
  width: 68%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ee877d, var(--primary));
  animation: meter 1.2s ease-in-out infinite alternate;
}

.video-transcript-steps {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.video-transcript-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  min-height: 50px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.video-transcript-step.is-active {
  border-color: #f1cec5;
  background: #fff5f2;
}

.video-transcript-step.is-done {
  background: #edf8ed;
}

.step-node {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: white;
  color: var(--muted);
}

.video-transcript-step strong {
  display: block;
  font-size: 13px;
}

.video-transcript-step em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.video-transcript-result-card {
  text-align: left;
}

.video-transcript-result-card:before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--success), transparent 38%);
}

.video-transcript-result-toolbar,
.video-transcript-result-foot {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fffdf9eb, #fff9f1c2);
}

.video-transcript-result-foot {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.video-transcript-result-toolbar strong {
  color: var(--success);
}

.video-transcript-reading {
  padding: 28px 38px 34px;
}

.video-transcript-reading h2 {
  margin: 0 0 10px;
  font-family: var(--system-display);
  font-size: 28px;
  font-weight: 700;
}

.video-transcript-reading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.video-transcript-reading-meta span,
.result-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}

.video-transcript-result p {
  margin: 0;
  color: var(--ink-2);
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 2.05;
}

.video-transcript-section + .video-transcript-section {
  margin-top: 16px;
}

.video-transcript-section strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 15px;
}

.auth-shell {
  background: linear-gradient(90deg, #e8e2d63d 1px, transparent 1px),
    linear-gradient(180deg, #e8e2d62e 1px, transparent 1px), var(--background);
  background-size: 46px 46px, 46px 46px, auto;
}

.auth-page {
  padding: 24px;
}

.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1392px;
  min-height: calc(100vh - 106px);
  margin: 0 auto;
  background: linear-gradient(90deg, transparent 0 50%, rgba(242, 237, 228, 0.88) 50% 100%);
}

.login-pitch {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 80px;
}

.login-pitch h1 {
  margin-top: 40px;
  font-size: 46px;
  line-height: 1.42;
}

.login-pitch-steps {
  display: grid;
  gap: 22px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.login-pitch-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.login-pitch-steps li span,
.login-steps span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--primary);
  border: 1px solid var(--primary-line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.login-card-wrap {
  display: grid;
  place-items: center;
  padding: 54px 44px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  width: 460px;
  max-width: 100%;
  padding: 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-modal);
}

.login-card-header {
  text-align: center;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-weight: 800;
}

.login-logo img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.login-card-header h1 {
  margin: 0;
  font-family: var(--system-display);
  font-size: 22px;
  font-weight: 600;
}

.login-card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.qrcode-container {
  position: relative;
  display: grid;
  place-items: center;
  width: 200px;
  height: 200px;
  margin: 24px auto 26px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
}

.qrcode-container img {
  width: 180px;
  height: 180px;
  object-fit: cover;
}

.qr-badge {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 13px;
  color: white;
  background: linear-gradient(180deg, #ff6677, #e43b54);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(228, 59, 84, 0.3);
  font-size: 12px;
  font-weight: 800;
}

.login-steps {
  display: grid;
  gap: 11px;
  margin-top: 8px;
}

.login-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.field {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  font-weight: 800;
}

.login-code-input {
  height: 49px;
  padding: 0 14px;
  background: white;
}

.full-width {
  width: 100%;
  min-height: 39px;
  margin-top: 16px;
}

.privacy-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.privacy-row a {
  color: var(--primary);
}

.login-footer {
  display: grid;
  gap: 9px;
  margin-top: 20px;
  color: var(--muted-light);
  text-align: center;
  font-size: 12px;
}

.login-footer span {
  color: var(--primary);
  font-weight: 800;
}

.error-box {
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--danger);
  background: #fff2ef;
  border: 1px solid #ffc8bd;
  border-radius: 9px;
  font-size: 13px;
}

.login-claim-button {
  color: var(--primary);
}

.login-claim-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  margin-top: 12px;
  padding: 11px 12px;
  color: #5f4f46;
  background: #fff9f1;
  border: 1px solid #f0d0bd;
  border-radius: 9px;
  font-size: 12px;
}

.login-claim-result strong {
  color: var(--primary);
  font-size: 20px;
  letter-spacing: 0.16em;
}

.login-claim-result small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(36, 31, 27, 0.44);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(430px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 44px));
  overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
}

.modal-header {
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

.prompt-config-backdrop {
  background: rgba(41, 36, 32, 0.38);
  backdrop-filter: blur(7px);
}

.prompt-config-modal {
  width: min(1080px, calc(100vw - 52px));
  max-height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 16px;
}

.prompt-config-header,
.prompt-config-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.prompt-config-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
}

.prompt-config-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.prompt-config-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.prompt-config-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 0;
  overflow: auto;
  background: linear-gradient(90deg, rgba(250, 247, 241, 0.74) 0 230px, #fff 230px);
}

.prompt-template-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 18px;
  border-right: 1px solid var(--border);
}

.prompt-template-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.prompt-template-item,
.prompt-template-add {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.prompt-template-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  color: var(--ink-2);
  background: white;
}

.prompt-template-item strong {
  font-size: 14px;
}

.prompt-template-item span,
.prompt-template-panel small {
  color: var(--muted);
  font-size: 12px;
}

.prompt-template-item.is-active {
  color: var(--primary);
  background: rgba(255, 246, 242, 0.95);
  border-color: rgba(255, 106, 91, 0.42);
  box-shadow: 0 8px 22px rgba(255, 94, 86, 0.12);
}

.prompt-template-add {
  padding: 13px 14px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

.prompt-config-main {
  display: grid;
  gap: 16px;
  padding: 22px 24px 24px;
}

.prompt-name-field {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.prompt-name-field span,
.prompt-text-field span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 900;
}

.prompt-name-field input,
.prompt-text-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
}

.prompt-name-field input {
  height: 38px;
  padding: 0 12px;
}

.prompt-mode-tabs {
  display: inline-flex;
  width: fit-content;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.prompt-mode-tabs button {
  min-width: 104px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.prompt-mode-tabs button.is-active {
  color: var(--primary);
  background: white;
  box-shadow: 0 4px 14px rgba(48, 37, 31, 0.12);
}

.prompt-text-field {
  display: grid;
  gap: 9px;
}

.prompt-text-field b {
  color: var(--primary);
}

.prompt-text-field textarea {
  resize: vertical;
  min-height: 110px;
  padding: 12px 13px;
  line-height: 1.65;
}

.prompt-image-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px;
  gap: 14px;
  align-items: stretch;
}

.prompt-reference-upload {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 150px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
}

.prompt-reference-upload svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.prompt-reference-upload strong {
  color: var(--ink-2);
}

.prompt-reference-upload small {
  color: var(--muted);
}

.prompt-config-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
  background: #fffdf9;
}

.image-edit-backdrop {
  align-items: center;
}

.image-edit-modal {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(430px, 1fr);
  width: min(1120px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  background: white;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(24, 18, 16, 0.28);
}

.image-edit-preview {
  min-height: 520px;
  background: #121212;
}

.image-edit-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-edit-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.image-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 28px 22px;
  border-bottom: 1px solid var(--border);
}

.image-edit-header h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 25px;
}

.image-edit-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.image-edit-close {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  background: var(--surface-soft);
  border-radius: 999px;
}

.image-edit-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 20px;
  padding: 24px 28px;
  background: #fffdfa;
}

.image-edit-textarea-wrap {
  position: relative;
  display: block;
  min-height: 240px;
}

.image-edit-textarea-wrap textarea {
  width: 100%;
  height: 100%;
  min-height: 240px;
  resize: vertical;
  padding: 24px 22px 42px;
  color: var(--ink);
  background: white;
  border: 2px solid #f4d9d5;
  border-radius: 16px;
  font-size: 18px;
  line-height: 1.55;
  outline: none;
}

.image-edit-textarea-wrap textarea::placeholder {
  color: #b8aaa0;
}

.image-edit-textarea-wrap span {
  position: absolute;
  left: 22px;
  bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.image-edit-ref-row {
  display: grid;
  align-content: start;
  gap: 10px;
}

.image-edit-ref-card {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 154px;
  color: var(--ink);
  background: #fffaf7;
  border: 1px solid #ecd8d1;
  border-radius: 14px;
  cursor: pointer;
}

.image-edit-ref-card strong {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary);
  background: #fff0ee;
  border: 1px solid #ffd2cb;
  border-radius: 999px;
  font-size: 27px;
  font-weight: 500;
}

.image-edit-ref-card span {
  font-size: 16px;
  font-weight: 900;
}

.image-edit-ref-copy strong,
.image-edit-ref-copy small {
  display: block;
}

.image-edit-ref-copy strong {
  color: var(--muted);
  font-size: 13px;
}

.image-edit-ref-copy small {
  color: var(--muted-soft);
  font-size: 12px;
}

.image-edit-footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  background: #faf6ef;
  border-top: 1px solid var(--border);
}

.image-edit-footer > strong {
  color: #6f6259;
  font-size: 16px;
}

.image-edit-switch {
  position: relative;
  width: 50px;
  height: 28px;
  padding: 0;
  background: #d8d1c8;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.image-edit-switch span {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 999px;
  transition: transform 0.18s ease;
}

.image-edit-switch.is-on {
  background: var(--primary);
}

.image-edit-switch.is-on span {
  transform: translateX(22px);
}

.image-edit-generate {
  min-width: 132px;
}

.feedback-help-qr-wrap {
  padding: 18px 28px 20px;
  background: var(--surface-soft);
}

.feedback-help-qr {
  width: 100%;
  max-height: 544px;
  object-fit: contain;
  background: #111;
  border-radius: 12px;
}

.modal-footer {
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.cookie-modal-backdrop {
  background: rgba(41, 36, 32, 0.47);
  backdrop-filter: blur(6px);
}

.cookie-modal {
  width: min(830px, calc(100vw - 42px));
  max-height: min(860px, calc(100vh - 42px));
  border-radius: 18px;
}

.cookie-modal-header {
  padding: 24px 28px 20px;
}

.cookie-modal-body {
  padding: 24px 32px 26px;
  background: #fffdfa;
}

.cookie-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.cookie-choice-card {
  position: relative;
  display: flex;
  min-height: 354px;
  flex-direction: column;
  padding: 28px 24px 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.cookie-choice-card.is-recommended {
  background: #fff0ed;
  border-color: #ef4e49;
  box-shadow: inset 0 0 0 1px rgba(239, 78, 73, 0.08);
}

.cookie-choice-badge {
  position: absolute;
  top: -16px;
  left: 20px;
  height: 28px;
  padding: 0 14px;
  color: white;
  background: #e1463f;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 28px;
}

.cookie-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cookie-card-head strong,
.cookie-direct-card strong {
  display: block;
  font-size: 18px;
}

.cookie-card-head em,
.cookie-direct-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
}

.cookie-plugin-logo,
.cookie-manual-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-weight: 900;
}

.cookie-plugin-logo {
  background: white;
  border-color: #ffd0ca;
}

.cookie-plugin-logo img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.cookie-steps {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding-left: 28px;
  color: var(--ink-2);
  line-height: 1.55;
}

.cookie-warning-box {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  margin-top: auto;
  padding: 12px 14px;
  color: var(--primary);
  background: white;
  border: 1px solid var(--primary-line);
  border-radius: 12px;
  line-height: 1.55;
}

.cookie-warning-box b {
  text-align: center;
}

.cookie-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.cookie-field {
  display: grid;
  gap: 10px;
  margin-top: auto;
  font-weight: 800;
}

.cookie-field textarea {
  min-height: 88px;
  padding: 13px 14px;
  background: white;
  border: 1px solid #f0d0bd;
  border-radius: 12px;
  color: var(--ink-2);
  font-family: var(--system-mono);
  font-size: 13px;
  resize: vertical;
}

.cookie-direct-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 20px 22px;
  background: #fff8f5;
  border: 1px solid var(--primary-line);
  border-radius: 15px;
}

.cookie-direct-card .primary-button {
  flex: 0 0 auto;
}

.cookie-modal-footer {
  padding: 16px 28px;
  background: #fffdfa;
}

.avatar-menu-popover {
  position: fixed;
  top: 54px;
  right: 14px;
  z-index: 500;
  width: 174px;
  padding: 7px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-3);
}

.avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 0 10px;
  color: var(--ink-2);
  font-weight: 700;
  text-align: left;
}

.avatar-menu-item:hover {
  color: var(--primary);
  background: var(--primary-paper);
}

.avatar-menu-divider {
  height: 1px;
  margin: 6px;
  background: var(--border);
}

.avatar-menu-danger {
  color: var(--danger);
}

#toast-root {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 1200;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 12px 12px 12px 14px;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--info);
  border-left: 3px solid var(--info);
  border-radius: 11px;
  box-shadow: var(--shadow-3);
  pointer-events: auto;
  animation: toast-enter 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast-card.success {
  border-color: var(--success);
  border-left-color: var(--success);
}

.toast-card.warning {
  border-color: var(--warning);
  border-left-color: var(--warning);
}

.toast-card.error {
  border-color: var(--danger);
  border-left-color: var(--danger);
}

.toast-icon {
  color: var(--info);
}

.toast-card.success .toast-icon {
  color: var(--success);
}

.toast-card.warning .toast-icon {
  color: var(--warning);
}

.toast-card.error .toast-icon {
  color: var(--danger);
}

.toast-icon svg {
  width: 18px;
  height: 18px;
}

.toast-title {
  font-size: 12.5px;
  font-weight: 700;
}

.toast-message {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(212, 75, 67, 0.16);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.mini {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.hidden-input {
  display: none;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.55;
    transform: scale(0.78);
  }
}

@keyframes meter {
  from {
    width: 32%;
  }
  to {
    width: 86%;
  }
}

@keyframes shimmer {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -180% 0;
  }
}

@media (max-width: 1120px) {
  .rewrite-workbench-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .rewrite-publish-panel {
    grid-column: 1 / -1;
  }

  .rewrite-action-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .imagegen-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .notes-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .login-layout {
    grid-template-columns: 1fr;
    background: rgba(242, 237, 228, 0.5);
  }

  .login-pitch {
    padding: 48px 40px 12px;
  }

  .login-card-wrap {
    padding-top: 20px;
  }
}

@media (max-width: 980px) {
  .rewrite-workbench-grid {
    grid-template-columns: 1fr;
  }

  .rewrite-source-panel {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
  }

  .rewrite-source-panel .rewrite-panel-title,
  .rewrite-source-meta {
    grid-column: 1 / -1;
  }

  .rewrite-source-panel h2 {
    align-self: end;
    margin-top: 0;
  }

  .rewrite-action-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-transcript-shell {
    grid-template-columns: 1fr;
  }

  .video-transcript-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .video-transcript-sidebar-head {
    display: none;
  }

  .video-transcript-history {
    max-height: 210px;
    overflow: auto;
  }

  .video-transcript-main {
    padding: 24px 14px 34px;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 9px 12px;
    min-height: 90px;
    padding: 9px 16px;
  }

  .topbar-login {
    min-height: 58px;
  }

  .brand-ai {
    display: none;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-links a {
    flex: none;
    height: 30px;
    padding: 0 9px;
  }

  .feedback-help-label {
    display: none;
  }

  .feedback-help-chip {
    width: 34px;
    padding: 0;
  }

  .hero {
    min-height: 539px;
    padding: 42px 16px 28px;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero h1 {
    font-size: 30px;
    line-height: 1.24;
  }

  .link-box {
    width: 100%;
    margin-top: 28px;
    padding: 14px;
    border-radius: 12px;
  }

  .tool-textarea {
    min-height: 118px;
  }

  .action-row,
  .imagegen-toolbar,
  .video-transcript-create-head,
  .video-transcript-create-foot,
  .video-transcript-result-toolbar,
  .video-transcript-result-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .imagegen-inline-controls {
    gap: 6px;
  }

  .seg-button,
  .ratio-select-trigger,
  .imagegen-ref-button {
    min-height: 29px;
    padding: 0 8px;
  }

  .ratio-select-trigger svg {
    width: 12px;
    height: 12px;
  }

  .imagegen-action-row {
    width: 100%;
    align-items: center;
    flex-direction: row;
  }

  .imagegen-action-row .imagegen-optimize-btn,
  .imagegen-action-row .imagegen-primary {
    width: auto;
    flex: 1 1 0;
  }

  .rewrite-workbench-shell {
    width: calc(100vw - 24px);
    padding-top: 20px;
  }

  .rewrite-workbench-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .rewrite-workbench-head h1 {
    font-size: 25px;
  }

  .rewrite-task-meta {
    justify-content: flex-start;
  }

  .rewrite-source-panel {
    display: block;
  }

  .rewrite-source-cover {
    aspect-ratio: 16 / 10;
  }

  .rewrite-source-panel p {
    -webkit-line-clamp: 5;
  }

  .rewrite-title-candidates button {
    padding: 11px;
  }

  .rewrite-field textarea {
    min-height: 260px;
  }

  .rewrite-tag-input-row,
  .rewrite-action-stack {
    grid-template-columns: 1fr;
  }

  .cookie-modal {
    width: calc(100vw - 24px);
  }

  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .cookie-config-grid,
  .cookie-action-row {
    grid-template-columns: 1fr;
  }

  .cookie-choice-card {
    min-height: 0;
    padding: 24px 18px 18px;
  }

  .cookie-direct-card,
  .cookie-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-direct-card .primary-button {
    width: 100%;
  }

  .image-edit-modal {
    grid-template-columns: 1fr;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  .image-edit-preview {
    min-height: 280px;
    max-height: 42vh;
  }

  .image-edit-body,
  .image-edit-footer {
    grid-template-columns: 1fr;
  }

  .image-edit-footer {
    align-items: stretch;
  }

  .image-edit-header,
  .image-edit-body,
  .image-edit-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .drop-zone {
    min-height: 250px;
  }

  .home-tool-strip {
    width: calc(100vw - 32px);
    padding-bottom: 32px;
  }

  .home-tool-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding: 16px;
  }

  .home-tool-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
  }

  .home-tool-card .button-link,
  .home-tool-tags {
    grid-column: 1 / -1;
  }

  .imagegen-first-screen {
    justify-content: flex-start;
    min-height: 486px;
    padding-top: 44px;
  }

  .imagegen-input-card {
    padding: 14px;
  }

  .imagegen-hero {
    padding-bottom: 30px;
  }

  .imagegen-section {
    width: calc(100vw - 32px);
    padding-top: 34px;
  }

  .imagegen-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .imagegen-section-head span {
    display: block;
    margin: 5px 0 0;
  }

  .imagegen-card-grid,
  .generated-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .imagegen-template-card,
  .imagegen-template-new {
    min-height: 0;
    height: 326px;
  }

  .rewrite-columns {
    grid-template-columns: 1fr;
  }

  .login-pitch {
    padding: 36px 22px 0;
  }

  .login-pitch h1 {
    margin-top: 28px;
    font-size: 36px;
  }

  .login-layout,
  .login-card-wrap {
    min-width: 0;
  }

  .login-card-wrap {
    width: 100%;
    padding: 22px 14px 36px;
  }

  .login-panel {
    width: 100%;
    padding: 22px;
  }
}

@media (max-width: 460px) {
  .points-nav-chip {
    min-width: 70px;
    padding: 0 9px;
  }

  .points-nav-label {
    display: none;
  }

  .imagegen-card-grid,
  .notes-grid,
  .generated-grid {
    grid-template-columns: 1fr;
  }

  .imagegen-template-card,
  .imagegen-template-new {
    height: auto;
  }

  .modal {
    width: calc(100vw - 24px);
  }
}

@media (max-width: 980px) {
  .rewrite-layout {
    grid-template-columns: 1fr;
  }

  .rewrite-right-stack {
    position: static;
  }

  .rewrite-status-strip {
    flex-wrap: wrap;
  }

  .prompt-config-body {
    grid-template-columns: 1fr;
    background: white;
  }

  .prompt-template-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .prompt-template-title,
  .prompt-template-panel small {
    grid-column: 1 / -1;
  }

  .rewrite-log-panel {
    grid-template-columns: 1fr;
  }

  .notes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .notes-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .notes-toolbar-actions {
    justify-content: flex-end;
  }

  .note-detail-backdrop {
    padding: 58px 16px 12px;
  }

  .note-detail-modal {
    width: min(820px, calc(100vw - 32px));
  }
}

@media (max-width: 760px) {
  .rewrite-status-panel,
  .rewrite-edit-card,
  .rewrite-image-manager,
  .rewrite-preview-card,
  .rewrite-publish-actions {
    border-radius: 12px;
    padding: 14px;
  }

  .rewrite-workbench-shell,
  .notes-shell {
    width: calc(100vw - 24px);
    padding-top: 18px;
  }

  .rewrite-status-strip,
  .rewrite-image-actions,
  .notes-head,
  .notes-toolbar-actions,
  .rewrite-image-head,
  .rewrite-preview-head,
  .rewrite-publish-actions header {
    align-items: stretch;
    flex-direction: column;
  }

  .notes-search {
    flex: none;
    width: 100%;
  }

  .notes-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .notes-filter-chip {
    flex: none;
  }

  .prompt-toggle-chip {
    margin-left: 0;
  }

  .rewrite-status-chip,
  .prompt-toggle-chip,
  .log-toggle-chip,
  .image-bulk-text-button,
  .rewrite-image-actions > span {
    justify-content: center;
    width: 100%;
  }

  .rewrite-image-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .image-card footer {
    grid-template-columns: 22px 1fr auto;
  }

  .prompt-config-modal {
    width: calc(100vw - 24px);
  }

  .prompt-config-header,
  .prompt-config-footer,
  .prompt-config-main,
  .prompt-template-panel {
    padding-right: 16px;
    padding-left: 16px;
  }

  .prompt-name-field,
  .prompt-image-row,
  .prompt-template-panel {
    grid-template-columns: 1fr;
  }

  .rewrite-generation-row,
  .rewrite-publish-grid,
  .xhs-preview-footer {
    grid-template-columns: 1fr;
  }

  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .notes-head h1 {
    font-size: 25px;
  }

  .note-detail-backdrop {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .note-detail-modal {
    width: 100vw;
    max-height: 100vh;
    border-width: 0;
  }

  .note-detail-hero {
    min-height: 44vh;
  }

  .note-detail-hero img {
    max-height: 52vh;
  }

  .note-detail-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
