:root {
  --bg: #f4f1ea; --card: #fff; --ink: #1d2a2b; --muted: #6b7778; --line: #e3ddd0;
  --brand: #0f3d3e; --brand2: #e07a3f; --ok: #1f8a4c; --bad: #c0392b; --r: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
main { max-width: 680px; margin: 0 auto; padding: 12px 12px 80px; }
h1 { margin: 6px 0; font-size: 26px; }
h2 { font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 15px; margin: 22px 0 6px; }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .hidden { display: none !important; }

header { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--brand); color: #fff; }
header .company { flex: 1; min-width: 0; font-weight: 600; background: rgba(255,255,255,.12); color: #fff; border: 0; }
header .company option { color: var(--ink); }
header .brand { flex: 1; font-weight: 700; }
header .icon { background: rgba(255,255,255,.12); color: #fff; }

.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 0 0 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); scroll-margin-top: 70px; }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; background: #f7f4ee; padding: 12px; border-radius: 10px; }
label.check input { width: 22px; height: 22px; flex: none; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { resize: vertical; font-size: 15px; }

button, .btn { font: inherit; font-weight: 600; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 11px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.big { width: 100%; margin-top: 14px; min-height: 52px; font-size: 17px; }
.card > .primary:not(.big) { width: 100%; margin-top: 10px; }
.danger { color: var(--bad); border-color: #f0c8c2; width: 100%; margin-top: 12px; }
.link { border: 0; background: none; color: var(--brand); padding: 6px 0; min-height: 0; text-decoration: underline; }
.icon { width: 44px; padding: 0; font-size: 20px; border: 0; }
.small.btn { min-height: 38px; padding: 7px 12px; font-size: 14px; margin-top: 8px; }

.row { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.row input { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > * { flex: 1 1 auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.chip.on, .seg .on { background: var(--brand2); border-color: var(--brand2); color: #fff; }
.seg { display: flex; gap: 6px; } .seg button { flex: 1; padding: 10px 6px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 4px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; padding: 0; border: 3px solid transparent; overflow: hidden; aspect-ratio: 4/3; border-radius: 12px; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.on { border-color: var(--brand2); box-shadow: 0 0 0 2px var(--brand2); }
.tile .src { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 6px; }

.preview { width: 100%; border-radius: 12px; display: block; background: #eee; }
.preview.small { max-height: 220px; object-fit: cover; }
.editbox { margin-top: 10px; background: #f7f4ee; padding: 12px; border-radius: 12px; }
.waiting { text-align: center; padding: 30px 0; color: var(--muted); }

.post { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; transition: border-color .3s; }
.post.done { border-color: var(--ok); background: #f4fbf6; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-head .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.post-head .tick { margin-left: auto; color: var(--ok); font-weight: 700; font-size: 20px; }
.post input { margin-bottom: 8px; }
.verify.glow { border-color: var(--ok); color: var(--ok); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,138,76,.45); } 50% { box-shadow: 0 0 0 7px rgba(31,138,76,0); } }

.note { background: #fff6e8; border-left: 4px solid var(--brand2); padding: 10px 12px; border-radius: 8px; font-size: 14px; }

.login { max-width: 360px; margin: 14vh auto 0; padding: 24px; text-align: center; }
.login input { margin: 18px 0 4px; text-align: center; }
.logo { font-size: 46px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: flex; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 680px; height: 100%; display: flex; flex-direction: column; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; background: var(--brand); color: #fff; }
.sheet-top .icon { color: #fff; background: none; }
.tabs { display: flex; overflow-x: auto; gap: 6px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.tabs button { flex: none; min-height: 38px; padding: 6px 14px; border-radius: 999px; }
.tabs .on { background: var(--brand); color: #fff; border-color: var(--brand); }
.sheet-body { overflow-y: auto; padding: 14px 16px 60px; flex: 1; }
.listrow { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; }
.platform { background: #fff; border-radius: 12px; padding: 12px; margin-top: 10px; }
.platform input { margin-top: 6px; }
.connected { color: var(--ok); font-weight: 600; margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.spin { width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: sp .7s linear infinite; }
.spin.big { width: 34px; height: 34px; color: var(--brand); }
@keyframes sp { to { transform: rotate(360deg); } }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); z-index: 99; transition: transform .25s; font-size: 15px; }
#toast.show { transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }
.pf-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-weight: 600; }
.pf-head input { width: 22px; height: 22px; flex: none; }
.pf-head .muted { margin-left: auto; font-weight: 400; }
.platform.off > :not(.pf-head) { display: none; }
.platform.off { opacity: .6; }
