/* InviteOS Studio — Ink & Foil design system
   ink #141117 · parchment #f6f1e7 · foil #b98a3c · blush #d8a7a0 · moss #4b5d4a */

:root {
	--ink: #141117;
	--ink-2: #221d26;
	--ink-3: #35303a;
	--parchment: #f6f1e7;
	--paper: #fffdf8;
	--line: #e5dccb;
	--foil: #b98a3c;
	--foil-soft: #d9b571;
	--blush: #d8a7a0;
	--moss: #4b5d4a;
	--danger: #a3402f;
	--text: #2a2430;
	--muted: #7d7468;
	--radius: 14px;
	--shadow: 0 10px 30px rgba(20, 17, 23, 0.10);
	--font-ui: 'Sora', system-ui, sans-serif;
	--font-display: 'Cormorant Garamond', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
	font-family: var(--font-ui);
	background: var(--parchment);
	color: var(--text);
	font-size: 14px;
	-webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--foil); }

#ios-app { display: flex; min-height: 100vh; }

/* ---------------- Rail ---------------- */
.ios-rail {
	width: 232px;
	flex-shrink: 0;
	background: var(--ink);
	color: #cfc6bb;
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
}
.ios-logo {
	padding: 26px 22px 20px;
	border-bottom: 1px solid rgba(217, 181, 113, 0.18);
}
.ios-logo .word {
	font-family: var(--font-display);
	font-size: 26px;
	font-weight: 600;
	letter-spacing: 0.5px;
	color: var(--parchment);
}
.ios-logo .word em { font-style: italic; color: var(--foil-soft); }
.ios-logo .sub {
	font-size: 10px;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: rgba(207, 198, 187, 0.55);
	margin-top: 4px;
}
.ios-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ios-nav button {
	display: flex; align-items: center; gap: 11px;
	width: 100%;
	background: none; border: 0;
	color: #b6ada2;
	padding: 11px 12px;
	border-radius: 9px;
	font-size: 13.5px;
	text-align: left;
	transition: background 0.15s, color 0.15s;
}
.ios-nav button svg { width: 17px; height: 17px; flex-shrink: 0; }
.ios-nav button:hover { background: var(--ink-2); color: var(--parchment); }
.ios-nav button.on {
	background: linear-gradient(90deg, rgba(185, 138, 60, 0.22), rgba(185, 138, 60, 0.06));
	color: var(--foil-soft);
	box-shadow: inset 2px 0 0 var(--foil);
}
.ios-rail-foot { padding: 16px 22px; border-top: 1px solid rgba(217, 181, 113, 0.14); font-size: 11.5px; color: rgba(207, 198, 187, 0.5); }
.ios-rail-foot a { color: #b6ada2; text-decoration: none; display: block; margin-top: 6px; }
.ios-rail-foot a:hover { color: var(--parchment); }

/* ---------------- Main ---------------- */
.ios-main { flex: 1; min-width: 0; padding: 34px 40px 70px; }
.ios-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.ios-head h1 {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 34px;
	letter-spacing: 0.3px;
	color: var(--ink);
}
.ios-head .crumb { font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ---------------- Buttons ---------------- */
.btn {
	border: 1px solid var(--line);
	background: var(--paper);
	color: var(--text);
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	display: inline-flex; align-items: center; gap: 8px;
	transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn.gold { background: var(--foil); border-color: var(--foil); color: #fff8ec; }
.btn.gold:hover { background: #a87c33; }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--parchment); }
.btn.danger { color: var(--danger); border-color: #e4c4bc; background: #fdf6f4; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }
.btn:focus-visible, .ios-nav button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 2px solid var(--foil);
	outline-offset: 2px;
}

/* ---------------- Cards & stats ---------------- */
.grid { display: grid; gap: 16px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid.c4, .grid.c3, .grid.c2 { grid-template-columns: 1fr; } }

.card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px 22px;
}
.stat .k { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--ink); line-height: 1.15; margin-top: 4px; }
.stat .v small { font-size: 18px; color: var(--muted); font-family: var(--font-ui); font-weight: 400; }
.stat.gold .v { color: var(--foil); }
.stat.moss .v { color: var(--moss); }

.section-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ink); margin: 30px 0 12px; }

/* ---------------- Event cards ---------------- */
.event-card { position: relative; overflow: hidden; }
.event-card::before {
	content: "";
	position: absolute; inset: 0 0 auto 0; height: 3px;
	background: linear-gradient(90deg, var(--foil), var(--blush));
}
.event-card h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink); }
.event-card .meta { color: var(--muted); font-size: 12.5px; margin: 6px 0 12px; line-height: 1.7; }
.event-card .pins { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag {
	font-size: 11px; letter-spacing: 0.6px;
	background: var(--parchment); border: 1px solid var(--line);
	padding: 4px 9px; border-radius: 99px; color: var(--muted);
}
.tag.gold { color: var(--foil); border-color: #e8d3ab; background: #fbf4e6; }
.bar { height: 6px; background: var(--parchment); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--moss), var(--foil)); border-radius: 99px; }
.event-card .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------------- Tables ---------------- */
.tbl { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl-wrap { border-radius: var(--radius); overflow: auto; border: 1px solid var(--line); }
.tbl-wrap .tbl { border: 0; }
.tbl th {
	text-align: left; font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase;
	color: var(--muted); font-weight: 600;
	padding: 12px 14px; background: #f2ecdf; border-bottom: 1px solid var(--line);
	white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid #efe8d9; font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fbf7ee; }
.pill { font-size: 11px; padding: 3px 10px; border-radius: 99px; font-weight: 600; display: inline-block; }
.pill.pending { background: #f1ead9; color: #8a7a52; }
.pill.confirmed { background: #e2ecdf; color: var(--moss); }
.pill.declined { background: #f4dfda; color: var(--danger); }
.pill.in { background: var(--moss); color: #eef4ec; }
.pill.sent { background: #efe4cf; color: var(--foil); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; letter-spacing: 1px; color: var(--ink-3); }

/* ---------------- Forms & modal ---------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
	width: 100%;
	border: 1px solid var(--line);
	background: var(--paper);
	border-radius: 10px;
	padding: 10px 12px;
	color: var(--text);
}
.field textarea { min-height: 90px; resize: vertical; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .frow { grid-template-columns: 1fr; } }

.modal-back {
	position: fixed; inset: 0;
	background: rgba(20, 17, 23, 0.55);
	backdrop-filter: blur(3px);
	display: flex; align-items: flex-start; justify-content: center;
	padding: 6vh 18px;
	z-index: 60;
	overflow: auto;
}
.modal {
	background: var(--paper);
	border-radius: 18px;
	width: 640px; max-width: 100%;
	padding: 26px 28px;
	box-shadow: 0 30px 80px rgba(20, 17, 23, 0.35);
	border-top: 3px solid var(--foil);
	animation: rise 0.22s ease;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } .btn { transition: none; } }
.modal h2 { font-family: var(--font-display); font-size: 25px; font-weight: 600; margin-bottom: 16px; color: var(--ink); }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------------- Studio ---------------- */
.studio { display: grid; grid-template-columns: 330px 1fr; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .studio { grid-template-columns: 1fr; } }
.tpl-list { display: grid; gap: 10px; }
.tpl-pick {
	display: flex; align-items: center; gap: 12px;
	border: 1px solid var(--line); background: var(--paper);
	border-radius: 12px; padding: 10px 12px;
	transition: border 0.15s, box-shadow 0.15s;
	text-align: left; width: 100%;
}
.tpl-pick:hover { box-shadow: var(--shadow); }
.tpl-pick.on { border-color: var(--foil); box-shadow: 0 0 0 2px rgba(185, 138, 60, 0.25); }
.tpl-swatch { width: 44px; height: 60px; border-radius: 6px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.08); }
.tpl-pick b { display: block; font-size: 13.5px; }
.tpl-pick span { font-size: 11.5px; color: var(--muted); }

.desk {
	background:
		radial-gradient(ellipse at 30% 20%, rgba(216, 167, 160, 0.18), transparent 55%),
		radial-gradient(ellipse at 80% 90%, rgba(185, 138, 60, 0.14), transparent 55%),
		var(--ink);
	border-radius: var(--radius);
	padding: 40px 20px;
	display: flex; flex-direction: column; align-items: center; gap: 18px;
	min-height: 620px;
}
.desk-note { color: rgba(246, 241, 231, 0.55); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.invite-stage {
	transform-origin: top center;
	box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.4);
	border-radius: 4px;
}
.studio-tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* progress overlay for batch export */
.busy-back { position: fixed; inset: 0; background: rgba(20,17,23,0.7); z-index: 90; display: flex; align-items: center; justify-content: center; }
.busy {
	background: var(--paper); border-radius: 16px; padding: 30px 40px; text-align: center; width: 340px;
}
.busy h3 { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; }
.busy .bar { margin-top: 14px; height: 8px; }

/* ---------------- Door live ---------------- */
.live-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .live-strip { grid-template-columns: repeat(2, 1fr); } }
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-row {
	display: flex; align-items: center; gap: 12px;
	background: var(--paper); border: 1px solid var(--line);
	border-radius: 11px; padding: 11px 14px;
}
.feed-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--moss); flex-shrink: 0; }
.feed-dot.plus { background: var(--blush); }
.feed-row b { font-size: 13.5px; }
.feed-row .sub { font-size: 12px; color: var(--muted); }
.feed-row time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------------- Misc ---------------- */
.empty {
	border: 1.5px dashed var(--line);
	border-radius: var(--radius);
	padding: 50px 24px;
	text-align: center;
	color: var(--muted);
}
.empty h3 { font-family: var(--font-display); font-size: 24px; color: var(--ink); margin-bottom: 6px; font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type="search"] {
	border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; width: 250px; background: var(--paper);
}
.toast {
	position: fixed; bottom: 26px; right: 26px;
	background: var(--ink); color: var(--parchment);
	padding: 13px 20px; border-radius: 12px;
	border-left: 3px solid var(--foil);
	box-shadow: 0 16px 40px rgba(0,0,0,0.35);
	z-index: 120;
	font-size: 13.5px;
	animation: rise 0.2s ease;
}
.toast.err { border-left-color: var(--danger); }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }
.hidden-render { position: fixed; left: -3000px; top: 0; }

@media (max-width: 860px) {
	#ios-app { flex-direction: column; }
	.ios-rail { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
	.ios-logo { border: 0; padding: 14px 16px; }
	.ios-nav { flex-direction: row; padding: 8px; }
	.ios-nav button { white-space: nowrap; }
	.ios-rail-foot { display: none; }
	.ios-main { padding: 22px 16px 60px; }
}

/* footer-menu repeater in settings */
#st-links .rep-row { display: grid; grid-template-columns: 1fr 1.4fr 36px; gap: 8px; margin-bottom: 8px; }
#st-links input { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: var(--paper); font-size: 13px; }
