/* MorningNote LIFF Studio - Core Design System (Vanilla CSS) */
:root {
  --bg-page: hsl(36, 33%, 97%);
  --bg-surface: hsl(0, 0%, 100%);
  --bg-subtle: hsl(35, 24%, 93%);
  --text-primary: hsl(24, 14%, 14%);
  --text-secondary: hsl(25, 8%, 42%);
  --border-subtle: hsl(32, 18%, 86%);
  --accent-warm: hsl(28, 42%, 36%);
  --accent-warm-fg: hsl(36, 33%, 98%);
  --line-green: hsl(145, 94%, 40%);
  --line-green-hover: hsl(145, 94%, 35%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 8px 28px -6px hsla(24, 20%, 15%, 0.07), 0 2px 6px -1px hsla(24, 20%, 15%, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--accent-warm);
  border: 1px solid var(--border-subtle);
}

.brand-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 920px) {
  .studio-grid {
    grid-template-columns: 7fr 5fr;
  }
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.section-heading {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 560px) {
  .tpl-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tpl-option {
  appearance: none;
  text-align: left;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.tpl-option:hover {
  transform: translateY(-1px);
  border-color: var(--accent-warm);
}

.tpl-option.is-active {
  border-color: var(--accent-warm);
  background: var(--bg-subtle);
}

.tpl-option strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.tpl-option span {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.pill-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn.is-active {
  background: var(--accent-warm);
  color: var(--accent-warm-fg);
  border-color: var(--accent-warm);
}

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

@media (min-width: 560px) {
  .form-grid.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent-warm);
}

.canvas-frame {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.canvas-frame canvas {
  display: block;
  width: 100%;
  height: auto;
}

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

.btn-line-send {
  appearance: none;
  border: none;
  border-radius: var(--radius-md);
  background: var(--line-green);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 13px 18px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-line-send:hover {
  background: var(--line-green-hover);
}

.btn-line-send:active {
  transform: scale(0.99);
}

.btn-secondary {
  appearance: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
}

.toast-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: hsl(145, 45%, 94%);
  color: hsl(145, 70%, 22%);
  border: 1px solid hsl(145, 40%, 82%);
}

.hidden {
  display: none !important;
}
