body.ppt-page {
  background: var(--bg, #f6f3ed);
}

.ppt-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 40px;
}

.ppt-topbar {
  margin-bottom: 16px;
}

.ppt-alert {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: color-mix(in srgb, #e0a83a 14%, var(--paper, #fff));
  color: var(--ink, #6a4b12);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #e0a83a 35%, transparent);
}

.ppt-alert code {
  font-size: 12px;
}

.ppt-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ppt-panel {
  background: var(--paper, #fff);
  border: none;
  border-radius: var(--radius-lg, 16px);
  padding: 18px 20px;
  box-shadow: var(--shadow, 0 8px 24px rgba(0, 0, 0, 0.06));
  display: grid;
  gap: 10px;
}

.ppt-panel h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.ppt-panel label {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted, #39414a);
}

.ppt-panel input,
.ppt-panel select,
.ppt-panel textarea {
  font-weight: 400;
  background: var(--bg, #fff);
  border: 1px solid transparent;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--line, #ddd);
  color: var(--ink);
  padding: 8px 10px;
}

.ppt-panel input:focus,
.ppt-panel select:focus,
.ppt-panel textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--accent, #1d6f8f);
}

.ppt-wide {
  grid-column: 1 / -1;
}

.ppt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ppt-actions .primary,
.ppt-preview-head button,
.ppt-edit-foot-actions button,
.ppt-revise-foot-actions button {
  border-radius: var(--radius-pill, 999px);
  border: none;
  font-weight: 600;
}

.ppt-actions .primary {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.ppt-actions .primary:hover { filter: brightness(1.05); }

.ppt-preview-head button,
.ppt-edit-foot-actions button:not(.primary),
.ppt-revise-foot-actions button:not(.primary) {
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.ppt-edit-foot-actions .primary,
.ppt-revise-foot-actions .primary {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}

.ppt-muted {
  color: var(--muted, #6b7280);
  font-size: 13px;
}

.ppt-hint {
  margin: 0;
  line-height: 1.5;
}

.ppt-preview-panel {
  min-height: 520px;
}

.ppt-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ppt-preview-head h3 {
  margin: 0;
}

.ppt-preview-frame {
  width: 100%;
  min-height: 360px;
  height: min(52vh, 520px);
  border: none;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line, #ddd);
  background: #111;
}

.ppt-deck-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.ppt-deck-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: var(--bg, #fafaf8);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ppt-deck-item .ppt-deck-actions button {
  border-radius: var(--radius-pill, 999px);
  border: none;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.ppt-deck-item strong {
  display: block;
  font-size: 14px;
}

.ppt-deck-item small {
  color: var(--muted, #6b7280);
}

.ppt-deck-item .ppt-deck-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ppt-edit-dialog {
  width: min(720px, 96vw);
  max-height: 90vh;
  border: none;
  border-radius: var(--radius-lg, 16px);
  padding: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  background: var(--paper);
  color: var(--ink);
}

.ppt-edit-dialog::backdrop {
  background: rgba(10, 10, 10, 0.45);
}

.ppt-edit-form {
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: 90vh;
}

.ppt-edit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line, #ddd);
}

.ppt-edit-head h3 {
  margin: 0 0 4px;
}

.ppt-edit-body {
  overflow: auto;
  padding: 12px 18px;
  display: grid;
  gap: 14px;
}

.ppt-edit-slide {
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg, #fafaf8);
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid;
  gap: 10px;
}

.ppt-edit-slide-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.ppt-edit-slide-head strong {
  font-size: 14px;
}

.ppt-edit-slide-head small {
  color: var(--muted, #6b7280);
  font-size: 12px;
}

.ppt-edit-field label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.ppt-edit-field textarea {
  min-height: 2.6em;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}

.ppt-edit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line, #ddd);
}

.ppt-edit-foot-actions {
  display: flex;
  gap: 8px;
}

.ppt-revise-dialog {
  width: min(560px, 96vw);
  max-height: 88vh;
  border: none;
  border-radius: var(--radius-lg, 16px);
  padding: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  background: var(--paper);
  color: var(--ink);
}

.ppt-revise-dialog::backdrop {
  background: rgba(10, 10, 10, 0.45);
}

.ppt-revise-shell {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
  max-height: 88vh;
}

.ppt-revise-chat {
  overflow: auto;
  padding: 12px 18px;
  display: grid;
  gap: 10px;
  background: var(--bg, #f3f4f6);
  min-height: 160px;
  max-height: 42vh;
}

.ppt-revise-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ppt-revise-msg.user {
  justify-self: end;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}

.ppt-revise-msg.assistant {
  justify-self: start;
  background: var(--paper);
  border: none;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
}

.ppt-revise-msg.system {
  justify-self: center;
  background: transparent;
  color: var(--muted, #6b7280);
  font-size: 12px;
  padding: 4px;
}

.ppt-revise-foot {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line, #ddd);
  display: grid;
  gap: 10px;
}

.ppt-revise-input-wrap {
  display: grid;
  gap: 6px;
}

.ppt-revise-input-wrap textarea {
  font-weight: 400;
  resize: vertical;
}

.ppt-revise-foot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ppt-deck-actions button[data-repair-deck] {
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-strong, var(--accent));
}

@media (max-width: 960px) {
  .ppt-layout {
    grid-template-columns: 1fr;
  }
}
