/* Dashboard + setup wizard. Phone first; wider screens get more room, not more stuff. */

body.app footer { margin-top: 24px; }
.dash { padding-bottom: 120px; }

/* ---------- server header + tabs ---------- */
.ghead { margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted); font: 600 15px var(--body);
  padding: 10px 8px; border-radius: 9px; cursor: pointer; min-height: 44px;
}
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset; }
.tabs button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* ---------- wizard ---------- */
.steps-bar { display: flex; gap: 6px; margin: 0 0 6px; }
.steps-bar span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-2); }
.steps-bar span.on { background: var(--accent); }
.step-meta { color: var(--faint); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin: 10px 0 4px; }
.step-title { font-size: 26px; margin-bottom: 6px; }
.step-lead { color: var(--muted); margin: 0 0 20px; }

.wiz-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(18, 11, 8, 0.94); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.wiz-bar .inner { max-width: 1080px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.wiz-bar .info { flex: 1; color: var(--muted); font-size: 14px; min-width: 0; }
.wiz-bar .btn { min-height: 46px; }

.notice-ok { background: var(--accent-soft); border: 1px solid rgba(246, 180, 92, 0.3); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; color: var(--text); }

/* template cards */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tpl {
  text-align: left; display: flex; gap: 14px; align-items: flex-start; width: 100%;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; color: var(--text); font: inherit; transition: border-color 0.15s, background 0.15s;
}
.tpl:hover { border-color: var(--faint); }
.tpl[aria-pressed="true"] { border-color: var(--accent); background: rgba(236, 143, 51, 0.08); }
.tpl .em { font-size: 30px; line-height: 1; flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; }
.tpl b { display: block; font-family: var(--head); font-size: 17px; margin-bottom: 2px; }
.tpl small { color: var(--muted); font-size: 14px; line-height: 1.45; display: block; }

/* choice cards (one / several languages) */
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.choice { text-align: left; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px; color: var(--text); font: inherit; cursor: pointer; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: rgba(236, 143, 51, 0.08); }
.choice b { display: block; margin-bottom: 2px; }
.choice small { color: var(--muted); font-size: 13.5px; line-height: 1.4; display: block; }

.field-label { font-weight: 600; margin: 18px 0 8px; display: block; }
.field-hint { color: var(--faint); font-size: 13.5px; margin: -4px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 8px 14px; font: 500 15px var(--body); cursor: pointer; min-height: 40px;
}
.chip[aria-pressed="true"] { border-color: var(--accent); background: rgba(236, 143, 51, 0.12); }
.chip .ord { background: var(--accent); color: #1a0d05; border-radius: 999px; font-size: 11px; font-weight: 700; width: 18px; height: 18px; display: grid; place-items: center; }

.setting { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; }
.setting .txt { flex: 1; min-width: 0; }
.setting .txt b { display: block; }
.setting .txt small { color: var(--muted); font-size: 14px; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 8px; font: 500 14px var(--body); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* Discord-like channel list */
.side { background: #1a120d; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.cat { padding: 6px 0 10px; }
.cat + .cat { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.cat-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 8px; min-height: 44px; }
.cat-head .nm { flex: 1; min-width: 0; font: 700 13px var(--body); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; text-align: left; padding: 6px 0; cursor: pointer; }
.cat.off .cat-head .nm, .ch.off .nm { text-decoration: line-through; opacity: 0.5; }
.cat.off .ch-list { display: none; }
.ch { display: flex; align-items: center; gap: 8px; padding: 2px 6px 2px 8px; border-radius: 8px; min-height: 44px; }
.ch:hover { background: rgba(255, 255, 255, 0.03); }
.ch .ico { color: var(--faint); width: 20px; text-align: center; flex: none; font-size: 16px; }
.ch .nm { flex: 1; min-width: 0; background: none; border: 0; color: #d9cfc3; font: 500 15px var(--body); text-align: left; padding: 8px 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .nm:disabled { cursor: default; }
.acc {
  border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); border-radius: 999px;
  font: 600 11.5px var(--body); padding: 4px 9px; cursor: pointer; white-space: nowrap; flex: none;
}
.acc.team, .acc.admins { color: #ffb4a0; border-color: rgba(255, 140, 110, 0.35); }
.acc.readonly, .acc.public { color: var(--accent-2); border-color: rgba(246, 180, 92, 0.35); }
.tag-lang { font: 700 10.5px var(--body); color: var(--accent-2); background: var(--accent-soft); border-radius: 999px; padding: 3px 7px; flex: none; text-transform: uppercase; letter-spacing: 0.04em; }
.add-ch { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--faint); font: 500 14.5px var(--body); padding: 10px 8px; cursor: pointer; border-radius: 8px; min-height: 44px; }
.add-ch:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }

/* small switch for list rows */
.switch.sm { width: 42px; height: 24px; }
.switch.sm .track::after { width: 16px; height: 16px; }
.switch.sm input:checked + .track::after { transform: translateX(18px); }

/* roles */
.role-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 10px 14px; min-height: 60px; }
.role-row + .role-row { margin-top: 8px; }
.role-row.off { opacity: 0.55; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--faint); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04); }
.role-row .main { flex: 1; min-width: 0; background: none; border: 0; text-align: left; color: var(--text); font: inherit; cursor: pointer; padding: 4px 0; }
.role-row .main:disabled { cursor: default; }
.role-row .main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-row .main small { color: var(--muted); font-size: 13.5px; }
.add-row { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; background: transparent; border: 1.5px dashed var(--border); color: var(--muted); border-radius: var(--radius); padding: 14px; font: 600 15px var(--body); cursor: pointer; }
.add-row:hover { color: var(--text); border-color: var(--faint); }

/* review */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat b { display: block; font: 700 28px var(--head); color: var(--accent-2); }
.stat small { color: var(--muted); font-size: 13px; }
.warn { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.35); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.warn b { display: block; margin-bottom: 4px; }
.warn p { margin: 0 0 12px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; padding: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* progress */
.build { text-align: center; padding: 30px 0 10px; }
.build .big { font-size: 54px; line-height: 1; margin-bottom: 12px; }
.build h2 { font-size: 26px; margin-bottom: 8px; }
.build p { color: var(--muted); margin: 0 0 20px; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; max-width: 460px; margin: 0 auto 12px; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #d9771f, var(--accent-2)); border-radius: 999px; transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; }
.build .stepname { color: var(--faint); font-size: 14px; min-height: 1.4em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build .cta { justify-content: center; }

/* bottom sheet */
.sheet { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 520px; width: 100%; margin: auto; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.6); }
.sheet-inner { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 18px 20px; max-height: 85vh; overflow: auto; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; font-size: 20px; overflow-wrap: anywhere; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); color: var(--muted); cursor: pointer; font-size: 16px; flex: none; }
.input { width: 100%; background: var(--bg-2); border: 1.5px solid var(--border); border-radius: 10px; color: var(--text); font: 16px var(--body); padding: 12px 14px; min-height: 48px; }
.input:focus { outline: none; border-color: var(--accent); }
.opt-list { display: grid; gap: 8px; }
.opt { text-align: left; display: block; width: 100%; background: var(--bg-2); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text); font: inherit; cursor: pointer; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: rgba(236, 143, 51, 0.08); }
.opt b { display: block; }
.opt small { color: var(--muted); font-size: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; min-height: 46px; }
.btn-danger { background: transparent; border-color: rgba(248, 113, 113, 0.45); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* members */
.search { position: relative; margin: 6px 0 12px; }
.member { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 60px; }
.member + .member { margin-top: 8px; }
.member img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.member .who { flex: 1; min-width: 0; }
.member .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .who small { color: var(--faint); font-size: 13px; }
.mini-dots { display: flex; gap: 3px; flex: none; }
.mini-dots .dot { width: 10px; height: 10px; box-shadow: none; }
.h2 { font-size: 20px; margin: 28px 0 6px; }
.sub-lead { color: var(--muted); margin: 0 0 14px; font-size: 15px; }

@media (min-width: 720px) {
  .sheet { margin: auto; }
}
@media (max-width: 719px) {
  .sheet { margin: auto 0 0; max-width: none; }
  .sheet-inner { border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .step-title { font-size: 23px; }
  .stats { gap: 8px; }
  .stat b { font-size: 24px; }
}
@media (max-width: 380px) {
  .choice-row { grid-template-columns: 1fr; }
}

/* sheet: title and buttons stay reachable on long sheets */
.sheet-inner { padding-top: 0; padding-bottom: 0; }
.sheet-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 18px 0 12px; margin-bottom: 4px; }
.sheet-body { padding-bottom: 18px; }
.sheet-actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 calc(4px + env(safe-area-inset-bottom)); margin-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 719px) {
  .dash { padding-top: 18px; }
  .back { margin-bottom: 12px; }
  .ghead { gap: 12px; margin-bottom: 14px; }
  .ghead .gi { width: 44px; height: 44px; border-radius: 12px; }
  .ghead h1 { font-size: 21px; }
  .ghead .plan { margin-top: 3px; }
  .tabs { margin-bottom: 18px; }
}

/* server pages: a focused column on big screens */
.dash.narrow { max-width: 820px; }
.wiz-bar .inner { max-width: 788px; }

/* ---------- round 2: fonts, emojis, order, tickets, server tab ---------- */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; min-width: max-content; padding: 10px 12px; }
.setting-btn { width: 100%; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.setting-btn:hover { border-color: var(--faint); }
.chev { color: var(--faint); font-size: 22px; line-height: 1; flex: none; }
.name-sample { background: #1a120d; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; }
.name-sample .ch { min-height: 38px; }
.name-sample .nm { cursor: default; }
.sep-chips .chip { min-width: 44px; justify-content: center; font-size: 17px; padding: 6px 12px; }
.font-list .font-opt b { font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-bottom: 10px; }
.emo { height: 44px; border-radius: 10px; border: 1.5px solid transparent; background: var(--bg-2); font-size: 22px; cursor: pointer; padding: 0; color: var(--muted); }
.emo[aria-pressed="true"] { border-color: var(--accent); background: rgba(236, 143, 51, 0.12); }
.emo.none { font-size: 18px; }
.move-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tickets-box { margin-top: 8px; }
.tk-emoji { width: 28px; text-align: center; font-size: 20px; flex: none; }
.gap { margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; margin-bottom: 14px; }
.panel-title { font-size: 20px; margin-bottom: 12px; }
.panel .field-label:first-of-type { margin-top: 12px; }
.profile-row { display: flex; align-items: center; gap: 16px; }
.srv-icon { width: 80px; height: 80px; border-radius: 22px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font: 700 26px var(--head); color: var(--muted); flex: none; }
.srv-icon img { width: 100%; height: 100%; object-fit: cover; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.banner-prev { display: block; width: 100%; border-radius: 12px; margin-bottom: 10px; }
.rules-input { resize: vertical; line-height: 1.5; margin-bottom: 12px; font-size: 15px; }
textarea.input { min-height: 0; }
select.input { appearance: auto; }
.event-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ev-date { width: 52px; height: 52px; border-radius: 12px; background: var(--surface-2); display: grid; place-content: center; text-align: center; flex: none; line-height: 1.1; }
.ev-date b { font: 700 20px var(--head); color: var(--accent-2); }
.ev-date small { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.ev-txt { flex: 1; min-width: 0; }
.ev-txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-txt small { color: var(--muted); font-size: 13.5px; }
.audit-chips { margin-bottom: 8px; }
.audit-chips .chip, .who-filter .chip { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.who-filter { margin-bottom: 10px; }
.audit-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.audit-row img, .audit-row > .dot { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.au-txt { flex: 1; min-width: 0; }
.au-txt b { display: block; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.au-action { color: var(--accent-2); font-weight: 500; }
.au-txt small { display: block; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.au-reason { font-style: italic; }
.au-change { color: var(--faint) !important; }
.au-time { color: var(--faint); font-size: 12.5px; flex: none; text-align: right; max-width: 92px; }
.more { margin-top: 12px; }
.mod-box { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--border); }
.mod-chips { margin: 10px 0 4px; }
.mod-chips .chip { min-height: 38px; font-size: 14px; }
.sheet-actions.plain { position: static; border: 0; padding: 0; margin-top: 12px; }
@media (max-width: 719px) {
  .tabs button { flex: 1 0 auto; font-size: 14px; padding: 10px 10px; }
  .au-time { max-width: 70px; }
}

/* drag & drop sorting */
.grip { flex: none; width: 32px; height: 40px; margin-left: -6px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--faint); font-size: 18px; line-height: 1; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.grip:hover { color: var(--text); background: var(--surface-2); }
.grip:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.grip-gap { flex: none; width: 32px; margin-left: -6px; text-align: center; font-size: 13px; opacity: 0.6; }
.sorting, .sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.dragging { position: relative; z-index: 2; background: var(--surface-2) !important; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1.5px var(--accent); border-radius: 10px; }
.cat.dragging { padding-bottom: 4px; }
.sort-list > .role-row + .role-row { margin-top: 8px; }
.role-row.locked .main { opacity: 0.75; }

/* people in the role sheet */
.people-box .input { margin-bottom: 8px; }
.people { display: flex; flex-direction: column; gap: 6px; }
.people + .people { margin-top: 10px; }
.person { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; min-height: 52px; }
.person img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.person .who { flex: 1; min-width: 0; }
.person .who b, .person .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who small { color: var(--faint); font-size: 12.5px; }
.section-gap { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }

/* features: changes wait for "Apply" */
.module.changed { border-color: var(--accent) !important; background: rgba(236, 143, 51, 0.07); }
.mod-note { color: var(--accent-2); font-size: 13.5px; margin-top: 6px; }
.change-list { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 8px; }
.change-list li { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 14px; }
.change-list li.off { border-left-color: var(--faint); }
.change-list b, .change-list small { display: block; }
.change-list small { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
