@import url("/letterhead-generator/assets/css/letterhead-studio.v1.0.0.css");

:root {
  --brand: #126b62;
  --brand-dark: #0b514b;
  --navy: #17343a;
}

.studio-shell { grid-template-columns: 248px minmax(500px, 1fr) 370px; }
.inspector-panel { padding-bottom: 42px; }
.canvas-stage { min-height: 720px; background: #edf1f4; }
.canvas-paper::after { border-color: rgba(18, 107, 98, .42); }
.toolbar-group select#currencySelect { max-width: 90px; }
.toolbar-group select#copyMode { max-width: 136px; }
.template-card canvas { aspect-ratio: 1 / 1.414; }
.template-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(18, 107, 98, .15); }

.item-editor { display: grid; gap: 11px; margin-top: 16px; }
.item-card { position: relative; padding: 13px; border: 1px solid #dce4ea; border-radius: 12px; background: #fbfcfd; }
.item-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.item-card-head strong { color: #344054; font-size: .76rem; }
.item-card-actions { display: flex; gap: 3px; }
.item-action { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 7px; color: #667085; background: transparent; font-weight: 850; }
.item-action:hover { color: var(--ink); background: #eef2f6; }
.item-action.danger:hover { color: #b42318; background: #fff0ee; }
.item-action:disabled { opacity: .35; cursor: not-allowed; }
.item-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.item-card .field { margin-bottom: 8px; }
.item-card .field:last-child { margin-bottom: 0; }
.fee-line { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(84px, .7fr) minmax(94px, .7fr); gap: 8px; }
.item-amount { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #e5eaef; color: #667085; font-size: .69rem; }
.item-amount strong { color: var(--brand-dark); font-size: .78rem; }
.totals-editor { margin-top: 20px; }
.live-total-card { display: grid; gap: 3px; margin-top: 16px; padding: 16px; border-radius: 13px; color: #dff8f4; background: linear-gradient(145deg, #173d40, #126b62); box-shadow: 0 8px 22px rgba(18, 85, 79, .17); }
.live-total-card span { font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.live-total-card strong { color: #fff; font-size: 1.48rem; line-height: 1.2; }
.live-total-card small { color: #c9ece7; font-size: .67rem; }
.research-card { margin-top: 18px; padding: 14px; border-left: 4px solid #c6841d; border-radius: 10px; color: #65410f; background: #fff8e9; }
.research-card strong { display: block; font-size: .76rem; }
.research-card p { margin: 4px 0 0; font-size: .7rem; }
.upload-row { margin-bottom: 11px; }

.guide-hero { background: linear-gradient(135deg, #effaf8, #f8fafc 53%, #fff8e9); }
.answer-grid article > span { color: #0b514b; background: #ddf2ee; }
.responsible-note { background: #eef8f6; }

@media (max-width: 1400px) {
  .studio-shell { grid-template-columns: 220px minmax(470px, 1fr) 340px; }
  .toolbar-group { gap: 6px; }
  .toolbar-group > label { display: none; }
}

@media (max-width: 1160px) {
  .studio-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .inspector { grid-column: 1 / -1; max-height: none; position: static; border-top: 1px solid var(--line); border-left: 0; }
  .inspector-body { height: auto; max-height: 760px; }
  .inspector-panel { max-width: 800px; margin: 0 auto; }
}

@media (max-width: 760px) {
  .header-actions #undoButton,
  .header-actions #redoButton { display: none; }
  .studio-shell { display: block; }
  .canvas-stage { min-height: 520px; }
  .canvas-toolbar { align-items: stretch; }
  .toolbar-group:first-child { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 6px; }
  .toolbar-group:first-child > label { display: none; }
  .toolbar-group:first-child select,
  .toolbar-group select#currencySelect,
  .toolbar-group select#copyMode { width: 100%; max-width: none; min-width: 0; }
  .toolbar-title { order: 3; width: 100%; text-align: center; }
  .toolbar-end { justify-content: center; }
  .fee-line { grid-template-columns: 1fr 1fr; }
  .fee-line .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .fee-line { grid-template-columns: 1fr; }
  .fee-line .field:first-child { grid-column: auto; }
  .canvas-stage { padding: 14px 8px; }
  .toolbar-check span { display: none; }
}

@media print {
  .tool-ad-container { display: none !important; }
}
