:root {
  --bg: #faf6f1;
  --card: #ffffff;
  --ink: #2e2a26;
  --muted: #8a817a;
  --accent: #b08968;
  --accent-d: #9c7350;
  --line: #ece3d9;
  --ok: #4b8b6f;
  --danger: #b5524a;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(80, 60, 40, 0.10);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; }

header.hero {
  text-align: center;
  padding: 28px 0 12px;
}
header.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  color: var(--accent);
}
header.hero h1 { font-size: 30px; margin: 6px 0 2px; }
header.hero p { color: var(--muted); margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 18px;
}

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type="text"], textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdfb;
  color: var(--ink);
}
input[type="text"]:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
textarea { resize: vertical; min-height: 84px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600;
  padding: 14px 18px;
  border: none; border-radius: 14px;
  background: var(--accent); color: #fff;
  cursor: pointer; width: 100%;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-d); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--accent); width: auto; padding: 8px 4px; }

.seg { display: flex; gap: 8px; background: #f3ece4; padding: 5px; border-radius: 14px; }
.seg button {
  flex: 1; font: inherit; font-weight: 600; border: none; cursor: pointer;
  padding: 10px; border-radius: 10px; background: transparent; color: var(--muted);
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.vis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.vis .opt {
  border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer;
  background: #fffdfb; text-align: left;
}
.vis .opt.active { border-color: var(--accent); background: #fbf3ea; }
.vis .opt .t { font-weight: 700; font-size: 14px; }
.vis .opt .d { font-size: 12px; color: var(--muted); margin-top: 2px; }

.field { margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.preview { margin-top: 12px; text-align: center; }
.preview img, .preview video { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.trim { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fdf8f2; }
.trim video { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.trimbar { position: relative; height: 26px; background: #ece3d9; border-radius: 9px; margin-top: 8px; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; }
.trimwin { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: linear-gradient(180deg, var(--accent), var(--accent-d)); border-radius: 9px; }
.trimwin::after { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 60%; transform: translateY(-50%); background: #fff; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.trimhead { position: absolute; top: -3px; bottom: -3px; width: 3px; background: #3d342c; border-radius: 2px; transform: translateX(-1px); pointer-events: none; }
.trimends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.trimends span { font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: 90vw; text-align: center; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--danger); }

footer.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; }
.hidden { display: none !important; }
