:root {
  --bg: #0b0d0c;
  --panel: #111513;
  --panel-2: #161b18;
  --panel-3: #1c231f;
  --line: #2b342f;
  --text: #edf1ec;
  --muted: #98a39c;
  --gold: #c8a45c;
  --gold-bright: #e0bf78;
  --green: #6f9a78;
  --red: #bb6a64;
  --blue: #6f8ea6;
  --purple: #9076a6;
  --orange: #b7875f;
  --shadow: 0 16px 55px rgba(0,0,0,.28);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 75% 10%, rgba(107, 83, 42, .14), transparent 30%),
    linear-gradient(135deg, #090b0a, #0d100e 58%, #0a0d0b);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(11, 14, 12, .94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 22px; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid rgba(224,191,120,.55); color: var(--gold-bright);
  background: linear-gradient(145deg, #262117, #12140f); border-radius: 12px;
  font-family: Georgia, serif; font-size: 25px; box-shadow: inset 0 0 25px rgba(200,164,92,.08);
}
.brand strong { display: block; font-family: Georgia, serif; letter-spacing: .04em; font-size: 19px; }
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.nav { display: grid; gap: 7px; }
.nav-item {
  border: 0; background: transparent; color: #aeb7b1; cursor: pointer; text-align: left;
  padding: 12px 13px; border-radius: 10px; display: flex; gap: 11px; align-items: center;
  transition: .18s ease;
}
.nav-item span { width: 18px; color: #77827b; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(200,164,92,.18), rgba(200,164,92,.05)); color: var(--gold-bright); border: 1px solid rgba(200,164,92,.2); }
.nav-item.active span { color: var(--gold-bright); }
.sidebar-foot { margin-top: auto; display: grid; gap: 9px; }
.storage-note { padding: 12px 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.storage-note strong { display:block; font-size: 12px; color: var(--gold-bright); }
.storage-note span { display:block; font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

.main { min-width: 0; }
.topbar {
  min-height: 104px; padding: 24px clamp(20px, 4vw, 58px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; background: rgba(12, 15, 13, .72); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 2px 0 0; font-family: Georgia, serif; font-size: clamp(27px, 3vw, 38px); font-weight: 600; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.top-actions { margin-left: auto; }
.menu-button { display:none; background:transparent; border:0; font-size: 22px; cursor:pointer; }
.page-root { padding: 34px clamp(20px, 4vw, 58px) 70px; max-width: 1600px; margin: 0 auto; }

.hero {
  border: 1px solid rgba(200,164,92,.25); border-radius: 20px; min-height: 226px; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(12,15,13,.96), rgba(12,15,13,.76)),
    radial-gradient(circle at 80% 20%, rgba(200,164,92,.28), transparent 28%),
    linear-gradient(135deg, #1f241f, #101310);
  padding: clamp(25px, 4vw, 48px); display: flex; align-items: center; box-shadow: var(--shadow); position: relative;
}
.hero:after { content:""; position:absolute; inset: 0; opacity:.18; pointer-events:none; background-image: repeating-linear-gradient(120deg, transparent 0 28px, rgba(255,255,255,.04) 29px); }
.hero-content { max-width: 790px; position:relative; z-index:1; }
.hero h2 { font-family: Georgia, serif; font-size: clamp(30px, 5vw, 54px); line-height:1.03; margin: 9px 0 14px; font-weight: 500; }
.hero p { color:#b7c0ba; line-height:1.7; max-width: 720px; margin:0; }
.hero-actions { display:flex; gap:10px; margin-top:24px; flex-wrap:wrap; }

.grid { display:grid; gap:18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.section { margin-top: 28px; }
.section-head { display:flex; gap:15px; align-items:end; justify-content:space-between; margin-bottom:14px; }
.section-head h2 { margin:0; font-family:Georgia,serif; font-size:24px; font-weight:500; }
.section-head p { margin:5px 0 0; color:var(--muted); font-size:13px; }

.card { background: linear-gradient(150deg, rgba(23,28,25,.98), rgba(15,19,17,.98)); border:1px solid var(--line); border-radius:var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.14); }
.stat-card { padding:19px; }
.stat-card span { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.09em; }
.stat-card strong { display:block; font-size:31px; margin-top:8px; font-family:Georgia,serif; font-weight:500; }
.stat-card small { color:#7f8a83; }
.accent-gold { border-top:2px solid var(--gold); }
.accent-blue { border-top:2px solid var(--blue); }
.accent-green { border-top:2px solid var(--green); }
.accent-red { border-top:2px solid var(--red); }

.focus-card { padding:22px; min-height:170px; position:relative; overflow:hidden; }
.focus-card:after { content:""; position:absolute; width:130px; height:130px; border-radius:50%; background:rgba(200,164,92,.07); right:-40px; top:-35px; }
.focus-card .tag { margin-bottom:14px; }
.focus-card h3 { margin:0 0 8px; font-family:Georgia,serif; font-size:21px; font-weight:500; }
.focus-card p { color:var(--muted); font-size:13px; line-height:1.6; margin:0; }
.focus-card footer { margin-top:16px; font-size:11px; color:#7f8a83; }

.tag { display:inline-flex; align-items:center; border:1px solid var(--line); background:rgba(255,255,255,.025); color:#aeb7b1; border-radius:999px; padding:5px 9px; font-size:10px; font-weight:700; letter-spacing:.05em; }
.tag.critical { color:#eda39d; border-color:rgba(187,106,100,.42); background:rgba(187,106,100,.09); }
.tag.high { color:#e3b88f; border-color:rgba(183,135,95,.42); background:rgba(183,135,95,.09); }
.tag.medium { color:#d8c386; border-color:rgba(200,164,92,.34); background:rgba(200,164,92,.08); }
.tag.low { color:#9ba79f; }
.tag.finished { color:#9dcca8; border-color:rgba(111,154,120,.4); background:rgba(111,154,120,.09); }
.tag.working-on { color:#9fbdd2; border-color:rgba(111,142,166,.4); background:rgba(111,142,166,.1); }
.tag.testing { color:#bba6d2; border-color:rgba(144,118,166,.4); background:rgba(144,118,166,.1); }
.tag.planned { color:#dac17d; }
.tag.ideas { color:#a9aaa8; }
.tag.waiting { color:#e1b18b; }

.progress-list { padding: 8px 20px; }
.progress-row { display:grid; grid-template-columns: minmax(120px, 1fr) 2fr 46px; gap:13px; align-items:center; padding:13px 0; border-bottom:1px solid rgba(43,52,47,.75); }
.progress-row:last-child { border-bottom:0; }
.progress-row span { font-size:12px; }
.progress-bar { height:7px; border-radius:999px; background:#252d29; overflow:hidden; }
.progress-bar i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg, #8d7142, #d3b46e); }
.progress-row strong { font-size:12px; color:var(--muted); text-align:right; }

.toolbar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.search { flex:1 1 260px; min-width:190px; }
input, textarea, select {
  width:100%; background:#0e1210; border:1px solid #303a34; color:var(--text); border-radius:9px; padding:10px 11px; outline:none;
}
input:focus, textarea:focus, select:focus { border-color:rgba(200,164,92,.65); box-shadow:0 0 0 3px rgba(200,164,92,.08); }
textarea { resize:vertical; }
label { display:grid; gap:7px; color:#bac2bd; font-size:12px; font-weight:600; }

.kanban { display:grid; grid-template-columns: repeat(5, minmax(230px,1fr)); gap:14px; overflow-x:auto; padding-bottom:12px; align-items:start; }
.kanban-column { background:rgba(16,20,18,.76); border:1px solid var(--line); border-radius:14px; min-height:290px; }
.kanban-head { padding:13px 14px; display:flex; justify-content:space-between; border-bottom:1px solid var(--line); align-items:center; position:sticky; top:0; background:#121714; border-radius:14px 14px 0 0; z-index:1; }
.kanban-head strong { font-size:12px; }
.kanban-head span { color:var(--muted); font-size:11px; }
.kanban-cards { display:grid; gap:10px; padding:10px; min-height:230px; }
.task-card { background:linear-gradient(145deg,#1b211e,#141916); border:1px solid #303933; border-radius:11px; padding:13px; cursor:pointer; transition:.15s ease; }
.task-card:hover { border-color:#4a574f; transform:translateY(-1px); }
.task-card.dragging { opacity:.28; cursor:grabbing; transform:scale(.985); }
.task-drop-placeholder { min-height:74px; border:1px dashed rgba(200,164,92,.78); border-radius:11px; background:rgba(200,164,92,.07); box-shadow:inset 0 0 0 1px rgba(200,164,92,.05); animation:taskDropPulse .8s ease-in-out infinite alternate; }
.kanban-cards.has-drop-placeholder .empty-state { display:none; }
@keyframes taskDropPulse { from { opacity:.68; } to { opacity:1; } }
body.task-drag-active { cursor:grabbing; user-select:none; }
body.task-drag-active .kanban-column { transition:border-color .12s ease, background .12s ease; }
.kanban-column.drag-over { border-color:#8c7548; background:rgba(43,39,27,.82); }
.task-card h3 { margin:8px 0 8px; font-size:13px; line-height:1.45; }
.task-card p { margin:0; font-size:11px; line-height:1.5; color:var(--muted); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.task-meta { display:flex; justify-content:space-between; gap:8px; margin-top:12px; color:#78827c; font-size:10px; }
.empty-state { color:#69736d; text-align:center; padding:35px 10px; font-size:12px; border:1px dashed #303833; border-radius:9px; }

.reference-grid { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap:14px; }
.reference-card { padding:20px; position:relative; }
.reference-card h3 { font-family:Georgia,serif; font-weight:500; margin:0 40px 6px 0; font-size:20px; }
.reference-card .subtitle { color:var(--gold); font-size:11px; margin-bottom:13px; }
.reference-card p { white-space:pre-line; color:#aab3ad; font-size:12px; line-height:1.65; margin:0; }
.reference-card .edit-entry { position:absolute; right:11px; top:11px; }

.timeline { position:relative; padding-left:24px; }
.timeline:before { content:""; position:absolute; left:7px; top:8px; bottom:8px; width:1px; background:#38413c; }
.timeline-item { position:relative; padding:0 0 22px 16px; }
.timeline-item:before { content:""; position:absolute; left:-21px; top:7px; width:9px; height:9px; border:2px solid var(--gold); background:#121512; border-radius:50%; }
.timeline-item h3 { margin:0 0 5px; font-family:Georgia,serif; font-weight:500; }
.timeline-item p { margin:0; color:var(--muted); font-size:12px; line-height:1.55; }

.primary-button, .secondary-button, .ghost-button, .danger-button {
  border-radius:9px; padding:9px 13px; cursor:pointer; font-weight:700; font-size:12px; transition:.16s ease;
}
.primary-button { background:linear-gradient(180deg,#cfad66,#a47f3f); color:#17130c; border:1px solid #e3c57f; }
.primary-button:hover { filter:brightness(1.08); }
.secondary-button { background:#222a26; border:1px solid #39433d; }
.secondary-button:hover, .ghost-button:hover { border-color:#56625b; background:#29322d; }
.ghost-button { background:transparent; border:1px solid #343d38; color:#b6bfb9; }
.danger-button { background:rgba(187,106,100,.1); border:1px solid rgba(187,106,100,.42); color:#e69b95; }
.full { width:100%; text-align:center; }
.file-label { display:block; }
.icon-button { border:0; background:transparent; color:var(--muted); cursor:pointer; font-size:24px; padding:2px 8px; }
.mini-button { border:1px solid #3b453f; background:#1a201d; color:#aeb8b1; border-radius:8px; padding:6px 9px; cursor:pointer; font-size:10px; }
.mini-button:hover { color:var(--text); }

.modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.72); z-index:50; display:grid; place-items:center; padding:20px; backdrop-filter:blur(8px); }
.modal { width:min(690px,100%); max-height:92vh; overflow:auto; padding:22px; border-radius:17px; background:#131815; border:1px solid #38423c; box-shadow:0 25px 90px rgba(0,0,0,.5); display:grid; gap:15px; }
.modal-head { display:flex; justify-content:space-between; align-items:start; }
.modal h2 { margin:4px 0 0; font-family:Georgia,serif; font-weight:500; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.modal-actions { display:flex; align-items:center; gap:9px; padding-top:5px; }
.spacer { flex:1; }
.hidden { display:none !important; }
.toast { position:fixed; right:22px; bottom:22px; z-index:80; background:#1d241f; border:1px solid #445048; color:#e6ebe7; padding:12px 15px; border-radius:10px; box-shadow:var(--shadow); font-size:12px; }

.notice { padding:15px 17px; border-radius:12px; border:1px solid rgba(200,164,92,.25); background:rgba(200,164,92,.06); color:#c9d0cb; font-size:12px; line-height:1.6; }
.notice strong { color:var(--gold-bright); }
.empty-large { text-align:center; padding:55px 20px; color:var(--muted); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .grid-3, .reference-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:0; transform:translateX(-105%); transition:.2s ease; width:260px; box-shadow:20px 0 50px rgba(0,0,0,.35); }
  .sidebar.open { transform:translateX(0); }
  .menu-button { display:block; }
  .topbar { padding:18px 18px; min-height:88px; }
  .page-root { padding:22px 16px 55px; }
  .top-actions .secondary-button { padding:8px 10px; }
  .grid-2, .grid-3, .grid-4, .reference-grid { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:1fr; }
  .hero { min-height:0; }
}


.nav-section-label {
  margin: 18px 12px 6px;
  color: #67726b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.board-link-card {
  padding: 20px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 15px;
  cursor: pointer;
  transition: .16s ease;
}
.board-link-card:hover { transform: translateY(-2px); border-color: #4d5a52; }
.board-link-card h3 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.board-link-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.board-link-card footer { margin-top: 15px; color: #7f8a83; font-size: 11px; }
.board-link-card footer strong { color: var(--gold-bright); font-size: 14px; }
.board-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid #3d4841;
  background: #202722;
  color: var(--gold-bright);
  font-size: 18px;
}

.board-intro {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  border-left: 3px solid var(--gold);
}
.board-intro h2 { margin: 5px 0 7px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.board-intro p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.board-toolbar { margin-top: 0; }
.board-toolbar select { flex: 0 1 190px; }

@media (max-width: 780px) {
  .board-intro { align-items: stretch; flex-direction: column; }
  .board-intro .primary-button { width: 100%; }
}


/* v3 authentication and shared workspace */
.auth-gate { min-height:100vh; display:grid; place-items:center; padding:32px 18px; position:relative; overflow:hidden; background:radial-gradient(circle at 50% 15%,#273128 0,#111612 35%,#090c0a 78%); }
.auth-atmosphere { position:absolute; inset:0; opacity:.28; pointer-events:none; background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size:34px 34px; mask-image:linear-gradient(to bottom,black,transparent); }
.auth-wrap { position:relative; width:min(980px,100%); display:grid; grid-template-columns:1.1fr .9fr; gap:42px; align-items:center; }
.auth-brand h1 { font-family:Georgia,serif; font-size:clamp(38px,6vw,68px); line-height:1; margin:18px 0 16px; max-width:620px; }
.auth-brand>p:last-child { color:var(--muted); max-width:540px; font-size:16px; line-height:1.7; }
.brand-mark.large { width:68px; height:68px; font-size:34px; box-shadow:0 0 50px rgba(201,165,84,.17); }
.auth-card { background:linear-gradient(160deg,rgba(27,34,29,.98),rgba(14,18,15,.98)); border:1px solid #364039; padding:30px; border-radius:18px; box-shadow:0 28px 90px rgba(0,0,0,.45); }
.auth-card h2 { font-family:Georgia,serif; font-size:30px; margin:8px 0; }
.muted { color:var(--muted); line-height:1.55; }
.auth-form { display:grid; gap:15px; margin-top:24px; }
.auth-form label { display:grid; gap:7px; color:#b8c0ba; font-size:12px; font-weight:700; letter-spacing:.03em; }
.auth-form input { width:100%; background:#0d110e; color:var(--text); border:1px solid #384239; border-radius:9px; padding:12px 13px; font:inherit; }
.auth-form input:focus { outline:2px solid rgba(201,165,84,.25); border-color:var(--gold); }
.auth-links { display:flex; justify-content:space-between; gap:12px; margin-top:18px; }
.text-button { border:0; background:none; color:#cbb77b; cursor:pointer; padding:4px 0; font-size:12px; }
.auth-message { margin-top:16px; padding:11px 12px; border-radius:9px; background:#222b24; border:1px solid #405044; color:#d9e1db; line-height:1.5; font-size:12px; }
.auth-message.error { background:#2a1818; border-color:#6c3030; color:#f2c4c4; }
.qr-frame { width:220px; height:220px; margin:20px auto; padding:12px; border-radius:14px; background:white; display:grid; place-items:center; }
.qr-frame img { width:100%; height:100%; object-fit:contain; }
.secret-details { margin:0 0 18px; color:var(--muted); font-size:12px; }
.secret-details code { display:block; margin-top:9px; padding:10px; border-radius:8px; background:#0b0e0c; color:#e7d79b; word-break:break-all; user-select:all; }
.user-chip { display:flex; align-items:center; gap:9px; min-width:138px; }
.user-chip>span { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#2b362e; border:1px solid #4b5b4f; color:#e8d18f; font-family:Georgia,serif; }
.user-chip div { display:grid; }
.user-chip strong { font-size:12px; }
.user-chip small { font-size:10px; text-transform:capitalize; color:var(--muted); }
.online-note { display:flex; align-items:center; gap:9px; }
.connection-dot { width:9px; height:9px; border-radius:50%; background:#60b779; box-shadow:0 0 12px rgba(96,183,121,.5); flex:none; }
.connection-dot.offline { background:#b95d5d; box-shadow:none; }
.role-pill { display:inline-flex; padding:4px 8px; border:1px solid #48554a; border-radius:999px; text-transform:capitalize; font-size:11px; color:#d2d9d4; }
.permission-note { margin:14px 0; }
.setup-panel { border:1px solid #7a6632; background:linear-gradient(145deg,#292516,#18170f); }
.setup-panel h2 { font-family:Georgia,serif; }
.admin-table { width:100%; border-collapse:collapse; }
.admin-table th,.admin-table td { text-align:left; padding:12px 10px; border-bottom:1px solid #303831; font-size:12px; vertical-align:middle; }
.admin-table th { color:#9ea7a0; text-transform:uppercase; font-size:10px; letter-spacing:.09em; }
.admin-table select { min-width:145px; }
.security-grid { align-items:start; }
.security-status { display:grid; gap:12px; }
.security-line { display:flex; justify-content:space-between; gap:12px; border-bottom:1px solid #303831; padding-bottom:10px; }
.loading-page { min-height:50vh; display:grid; place-items:center; color:var(--muted); }
.loading-page::before { content:''; width:30px; height:30px; border-radius:50%; border:3px solid #344038; border-top-color:var(--gold); animation:spin .8s linear infinite; margin-right:12px; }
@keyframes spin { to { transform:rotate(360deg); } }
.read-only-banner { border-color:#55523d; background:#211f17; }
@media(max-width:850px){ .auth-wrap{grid-template-columns:1fr;max-width:560px}.auth-brand{text-align:center}.auth-brand>p:last-child{margin-inline:auto}.brand-mark.large{margin-inline:auto}.user-chip{display:none}.top-actions{gap:6px}.top-actions #logoutButton{display:none} }

/* v3.2: simpler copy, role-focused navigation and a less templated feel */
.nav-group { display: grid; gap: 7px; }
.nav-group + .nav-group { margin-top: 9px; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: none;
}
.stat-card span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.compact-hero { min-height: 155px; padding-block: 30px; }
.compact-hero h2 { font-size: clamp(30px, 4vw, 43px); }
.notice { color: #bac3bd; }
.reference-card { min-height: 190px; }
.reference-number {
  position: absolute;
  right: 16px;
  top: 14px;
  color: #59645d;
  font-family: Georgia, serif;
  font-size: 13px;
}
.empty-access {
  width: min(560px, 100%);
  margin: 9vh auto 0;
  padding: 38px;
  text-align: center;
}
.empty-access .board-icon { margin: 0 auto 18px; }
.empty-access h2 {
  margin: 8px 0 10px;
  font-family: Georgia, serif;
  font-size: 31px;
  font-weight: 500;
}
.empty-access p:not(.eyebrow) {
  margin: 0 auto 22px;
  max-width: 440px;
  color: var(--muted);
  line-height: 1.65;
}
@media (max-width: 780px) {
  .compact-hero { padding: 25px; }
  .empty-access { margin-top: 3vh; padding: 28px 22px; }
}

/* v3.3: keep workspace maintenance controls out of normal team accounts */
.admin-workspace-tools { display:grid; gap:10px; }

/* v3.4 — Builder reference images */
.reference-image-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.reference-image-post {
  padding: 18px;
  overflow: hidden;
}
.reference-post-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.reference-post-head h3 {
  margin: 4px 0 0;
  font: 500 22px/1.25 Georgia, serif;
}
.reference-post-notes {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.compact-button {
  min-height: 34px;
  padding: 7px 11px;
  white-space: nowrap;
}
.reference-image-grid {
  display: grid;
  gap: 7px;
  min-height: 210px;
  border-radius: 12px;
  overflow: hidden;
  background: #0d110f;
}
.reference-image-grid.image-count-1 { grid-template-columns: 1fr; }
.reference-image-grid.image-count-2 { grid-template-columns: repeat(2, 1fr); }
.reference-image-grid.image-count-3 { grid-template-columns: 1.3fr 1fr; grid-template-rows: repeat(2, 1fr); }
.reference-image-grid.image-count-3 > :first-child { grid-row: 1 / 3; }
.reference-image-grid.image-count-4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.reference-image-grid.image-count-5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(2, minmax(110px, 1fr)); }
.reference-image-grid.image-count-5 > :nth-child(1),
.reference-image-grid.image-count-5 > :nth-child(2) { grid-column: span 3; }
.reference-image-grid.image-count-5 > :nth-child(n+3) { grid-column: span 2; }
.reference-image-button {
  appearance: none;
  border: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #111713;
  cursor: zoom-in;
}
.reference-image-button img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  display: block;
  object-fit: cover;
  transition: transform .2s ease, opacity .2s ease;
}
.reference-image-button:hover img { transform: scale(1.025); opacity: .9; }
.reference-image-missing {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--muted);
  font-size: 12px;
}
.reference-post-modal { width: min(760px, 100%); }
.image-upload-field > input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed #4b5a51;
  border-radius: 10px;
  background: #0e1310;
  color: var(--text);
}
.image-upload-field > span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}
.selected-image-list { display: grid; gap: 8px; }
.image-selection-count {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  color: var(--muted);
  font-size: 11px;
}
.image-selection-count strong { color: var(--text); font-size: 12px; }
.selected-image-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #101512;
}
.selected-image-item.marked-for-removal { opacity: .55; }
.selected-image-item img,
.selected-image-placeholder {
  width: 58px;
  height: 45px;
  border-radius: 7px;
  object-fit: cover;
  background: #1a211d;
}
.selected-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: .08em;
}
.selected-image-item strong,
.selected-image-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-image-item strong { font-size: 12px; }
.selected-image-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 42px;
  background: rgba(3, 5, 4, .92);
  backdrop-filter: blur(10px);
}
.image-lightbox img {
  max-width: min(1500px, 94vw);
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 30px 100px rgba(0,0,0,.65);
}
.image-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 1px solid #4a574f;
  border-radius: 50%;
  background: #151b17;
  color: white;
  font-size: 24px;
  cursor: pointer;
}
@media (max-width: 900px) {
  .reference-image-posts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .reference-post-head { align-items: stretch; flex-direction: column; }
  .reference-image-grid.image-count-3,
  .reference-image-grid.image-count-5 { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; }
  .reference-image-grid.image-count-3 > :first-child,
  .reference-image-grid.image-count-5 > * { grid-column: auto; grid-row: auto; }
  .reference-image-button img { min-height: 120px; }
  .image-lightbox { padding: 18px; }
  .image-selection-count { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* v3.5 — collapsible navigation and restrained motion */
.app-shell {
  transition: grid-template-columns .24s cubic-bezier(.22,.8,.3,1), opacity .22s ease;
  opacity: 0;
}
.app-shell.app-visible { opacity: 1; }
.app-shell.sidebar-collapsed { grid-template-columns: 0 1fr; }
.app-shell.sidebar-collapsed .sidebar {
  transform: translateX(-108%);
  opacity: 0;
  pointer-events: none;
}
.sidebar {
  width: 260px;
  transition: transform .24s cubic-bezier(.22,.8,.3,1), opacity .18s ease, box-shadow .24s ease;
  will-change: transform;
}
.sidebar-collapse-button,
.sidebar-reopen-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 42px;
  padding: 0;
  border: 1px solid #36413a;
  background: rgba(16, 21, 18, .96);
  color: #b9c2bc;
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.24);
  transition: transform .16s ease, color .16s ease, border-color .16s ease, background .16s ease;
}
.sidebar-collapse-button:hover,
.sidebar-reopen-button:hover {
  color: var(--gold-bright);
  border-color: rgba(200,164,92,.55);
  background: #171c19;
}
.sidebar-collapse-button:active,
.sidebar-reopen-button:active { transform: scale(.94); }
.sidebar-collapse-button {
  position: absolute;
  top: 24px;
  right: -15px;
  z-index: 3;
  border-radius: 0 10px 10px 0;
}
.sidebar-reopen-button {
  position: fixed;
  top: 25px;
  left: 0;
  z-index: 35;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  animation: sidebar-handle-in .22s cubic-bezier(.22,.8,.3,1) both;
}
.app-shell.sidebar-collapsed .main { width: 100vw; }
.main { transition: width .24s ease; }

/* Fast, subtle page and component entrances */
.page-root.page-animating > * {
  animation: page-rise .28s cubic-bezier(.22,.8,.3,1) both;
}
.page-root.page-animating .card,
.page-root.page-animating .kanban-column,
.page-root.page-animating .reference-image-post,
.page-root.page-animating .board-intro,
.page-root.page-animating .notice,
.page-root.page-animating .section-head {
  animation: item-rise .30s cubic-bezier(.22,.8,.3,1) both;
  animation-delay: var(--enter-delay, 0ms);
}
.card,
.kanban-column,
.reference-image-post {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.task-card:hover,
.reference-card:hover,
.reference-image-post:hover {
  transform: translateY(-2px);
  border-color: #46534b;
  box-shadow: 0 14px 36px rgba(0,0,0,.22);
}
.nav-item { position: relative; overflow: hidden; }
.nav-item::after {
  content: '';
  position: absolute;
  inset: auto 12px 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224,191,120,.45), transparent);
  transform: scaleX(0);
  transition: transform .2s ease;
}
.nav-item:hover::after { transform: scaleX(1); }

/* Loading and overlays */
.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  animation: soft-fade .2s ease both;
}
.loading-page::before {
  margin-right: 0;
  box-shadow: 0 0 0 1px rgba(200,164,92,.06), 0 0 22px rgba(200,164,92,.10);
}
.modal-backdrop:not(.hidden),
.image-lightbox:not(.hidden) { animation: overlay-in .16s ease both; }
.modal-backdrop:not(.hidden) .modal { animation: modal-in .22s cubic-bezier(.22,.8,.3,1) both; }
.toast:not(.hidden) { animation: toast-in .22s cubic-bezier(.22,.8,.3,1) both; }
.auth-gate.auth-visible .auth-brand { animation: auth-rise .36s cubic-bezier(.22,.8,.3,1) both; }
.auth-gate.auth-visible .auth-card { animation: auth-rise .36s .06s cubic-bezier(.22,.8,.3,1) both; }

@keyframes page-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes item-rise {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sidebar-handle-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes soft-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 780px) {
  .app-shell,
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed .sidebar {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar-collapse-button {
    right: 10px;
    top: 18px;
    border-radius: 9px;
  }
  .sidebar-reopen-button { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
.topbar { transition: padding .24s cubic-bezier(.22,.8,.3,1), background .18s ease; }
.app-shell.sidebar-collapsed .topbar { padding-left: clamp(58px, 5vw, 80px); }
@media (max-width: 780px) {
  .app-shell.sidebar-collapsed .topbar { padding-left: 18px; }
}



/* v3.9 — slower, staggered dashboard entrances */
.page-root.page-animating > .dashboard-stats,
.page-root.page-animating > .dashboard-team-section {
  animation: none;
}

.page-root.page-animating .dashboard-hero {
  animation: dashboard-rise .56s cubic-bezier(.16, 1, .3, 1) both;
}

.page-root.page-animating .dashboard-stats .stat-card {
  animation: dashboard-rise .50s cubic-bezier(.16, 1, .3, 1) both;
}
.page-root.page-animating .dashboard-stats .stat-card:nth-child(1) { animation-delay: 120ms; }
.page-root.page-animating .dashboard-stats .stat-card:nth-child(2) { animation-delay: 175ms; }
.page-root.page-animating .dashboard-stats .stat-card:nth-child(3) { animation-delay: 230ms; }
.page-root.page-animating .dashboard-stats .stat-card:nth-child(4) { animation-delay: 285ms; }

.page-root.page-animating .dashboard-team-section .section-head {
  animation: dashboard-rise .50s 340ms cubic-bezier(.16, 1, .3, 1) both;
}
.page-root.page-animating .dashboard-team-section .board-link-card {
  animation: dashboard-rise .52s cubic-bezier(.16, 1, .3, 1) both;
}
.page-root.page-animating .dashboard-team-section .board-link-card:nth-child(1) { animation-delay: 405ms; }
.page-root.page-animating .dashboard-team-section .board-link-card:nth-child(2) { animation-delay: 470ms; }
.page-root.page-animating .dashboard-team-section .board-link-card:nth-child(3) { animation-delay: 535ms; }

@keyframes dashboard-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(1.5px);
  }
  70% { filter: blur(0); }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* v3.8 — granular team access */
.access-table td:first-child { min-width: 190px; }
.table-subline { display:block; margin-top:4px; color:#8f9992; font-size:11px; font-weight:400; }
.access-cell { display:flex; align-items:center; gap:10px; justify-content:space-between; min-width:280px; }
.access-chip-list { display:flex; flex-wrap:wrap; gap:6px; }
.access-chip { display:inline-flex; align-items:center; min-height:25px; padding:4px 8px; border:1px solid #3a463e; border-radius:999px; background:#19201c; color:#c8d0ca; font-size:10px; white-space:nowrap; }
.access-chip.full-access { border-color:#6a5832; background:#282316; color:#e5cb8a; }
.compact-button { min-height:32px; padding:7px 10px; font-size:11px; white-space:nowrap; }
.compact-button:disabled { opacity:.45; cursor:not-allowed; }

.access-modal { width:min(780px, 100%); }
.access-modal .modal-head p { max-width:590px; margin:8px 0 0; }
.permission-grid { display:grid; gap:9px; }
.permission-row { display:grid; grid-template-columns:minmax(210px,1fr) 116px 116px; align-items:center; gap:10px; padding:12px; border:1px solid #303a33; border-radius:12px; background:#101512; }
.permission-copy { display:grid; gap:4px; }
.permission-copy strong { color:#edf0ed; font-size:13px; }
.permission-copy span { color:#929c95; font-size:11px; line-height:1.45; }
.permission-toggle { position:relative; display:flex; align-items:center; gap:8px; min-height:38px; padding:8px 10px; border:1px solid #39443d; border-radius:9px; background:#171d19; cursor:pointer; color:#cbd2cd; font-size:12px; }
.permission-toggle:hover { border-color:#526158; }
.permission-toggle input { width:16px; height:16px; margin:0; accent-color:#a58a4e; }
.permission-toggle small { margin-left:auto; padding:2px 5px; border-radius:5px; background:#2a302b; color:#89928c; font-size:9px; text-transform:uppercase; letter-spacing:.07em; }
.permission-toggle.included-by-role { opacity:.68; cursor:default; }
.permission-help { margin:0; font-size:11px; }

@media (max-width: 900px) {
  .access-cell { min-width:220px; align-items:flex-start; flex-direction:column; }
  .permission-row { grid-template-columns:1fr 104px 104px; }
}

@media (max-width: 620px) {
  .permission-row { grid-template-columns:1fr 1fr; }
  .permission-copy { grid-column:1 / -1; }
  .permission-toggle { justify-content:center; }
}

/* v4.0 — chapter quest editor */
.questline-hero {
  align-items: center;
}

.quest-chapter-list {
  display: grid;
  gap: 18px;
}

.quest-chapter-card {
  padding: 0;
  overflow: hidden;
  border-color: rgba(195, 154, 73, 0.22);
  background:
    radial-gradient(circle at 92% 4%, rgba(195, 154, 73, 0.08), transparent 30%),
    var(--panel);
}

.quest-chapter-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.quest-chapter-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(195, 154, 73, 0.36);
  border-radius: 14px;
  color: var(--gold-bright);
  background: rgba(195, 154, 73, 0.07);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.quest-chapter-copy h3 {
  margin: 3px 0 8px;
  font-size: 1.45rem;
}

.quest-chapter-copy > p:last-child {
  margin: 0;
  max-width: 880px;
  color: var(--muted);
  line-height: 1.65;
}

.quest-chapter-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chapter-quest-list {
  display: grid;
}

.quest-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: start;
  padding: 19px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  background: rgba(255,255,255,0.012);
  transition: background 160ms ease, border-color 160ms ease;
}

.quest-item:last-child {
  border-bottom: 0;
}

.quest-item:hover {
  background: rgba(255,255,255,0.025);
}

.quest-item-order {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.quest-item-main {
  min-width: 0;
}

.quest-item-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quest-item-title-row h4 {
  margin: 1px 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.12rem;
}

.quest-status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quest-status.draft { color: #d8c38d; border-color: rgba(216,195,141,.35); background: rgba(216,195,141,.07); }
.quest-status.ready { color: #9ac8dc; border-color: rgba(106,171,201,.38); background: rgba(106,171,201,.08); }
.quest-status.implemented { color: #92c9a1; border-color: rgba(99,178,119,.38); background: rgba(99,178,119,.08); }

.quest-summary {
  margin: 8px 0 10px;
  color: var(--muted);
  line-height: 1.58;
}

.quest-requirements {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.quest-requirements strong {
  color: var(--text);
}

.quest-rewards {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}

.quest-rewards > span {
  color: var(--gold-bright);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quest-rewards p {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
}

.quest-edit-button {
  align-self: center;
}

.chapter-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.quest-modal {
  width: min(720px, calc(100vw - 28px));
}

.quest-form-grid {
  grid-template-columns: minmax(150px, .7fr) minmax(190px, 1fr);
}

@media (max-width: 820px) {
  .quest-chapter-head {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .quest-chapter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .quest-item {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 17px;
  }
  .quest-edit-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .quest-chapter-head {
    padding: 18px;
    gap: 12px;
  }
  .quest-chapter-number {
    width: 40px;
    height: 40px;
  }
  .quest-item {
    grid-template-columns: 1fr;
  }
  .quest-item-order {
    display: none;
  }
  .quest-edit-button {
    grid-column: 1;
  }
  .quest-rewards {
    grid-template-columns: 1fr;
  }
  .chapter-empty {
    align-items: flex-start;
    flex-direction: column;
  }
  .quest-form-grid {
    grid-template-columns: 1fr;
  }
}

/* v4.2 — keep sidebar controls reachable in installed app windows */
.sidebar {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.sidebar .brand { flex: 0 0 auto; }
.sidebar .nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}
.sidebar-foot {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(43, 52, 47, .78);
}
.sidebar .nav::-webkit-scrollbar { width: 6px; }
.sidebar .nav::-webkit-scrollbar-thumb {
  background: rgba(152, 163, 156, .24);
  border-radius: 999px;
}
.sidebar .nav::-webkit-scrollbar-track { background: transparent; }
@media (max-height: 720px) and (min-width: 781px) {
  .sidebar { padding-top: 18px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .brand { padding-bottom: 14px; }
  .nav { gap: 4px; }
  .nav-item { padding-top: 9px; padding-bottom: 9px; }
  .sidebar-foot { gap: 7px; margin-top: 8px; padding-top: 9px; }
  .storage-note { padding: 9px 11px; }
}


/* v4.7 — browser-aware install message shown only on Dashboard */
.dashboard-install-banner {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 15px 16px;
  border: 1px solid rgba(200, 164, 92, .32);
  border-radius: 14px;
  background:
    linear-gradient(115deg, rgba(200, 164, 92, .105), rgba(18, 23, 20, .90) 46%, rgba(17, 22, 19, .96)),
    var(--panel);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .16);
  overflow: hidden;
}
.dashboard-install-banner::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-bright), rgba(200, 164, 92, .22));
}
.install-banner-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(200, 164, 92, .34);
  border-radius: 11px;
  color: var(--gold-bright);
  background: rgba(200, 164, 92, .09);
  font-size: 1.25rem;
  font-weight: 800;
}
.install-banner-copy { min-width: 0; }
.install-banner-copy strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: .92rem;
}
.install-banner-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}
.install-banner-action { white-space: nowrap; }
.install-banner-close {
  align-self: start;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 1.18rem;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.install-banner-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .055);
}
.install-banner-close:active { transform: scale(.92); }
.dashboard-install-banner.is-dismissing {
  animation: install-banner-out .18s ease both !important;
}
.page-root.page-animating .dashboard-install-banner {
  animation: dashboard-rise .48s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes install-banner-out {
  to { opacity: 0; transform: translateY(-6px); }
}
@media (max-width: 720px) {
  .dashboard-install-banner {
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    gap: 11px;
    padding: 14px;
  }
  .install-banner-icon { width: 38px; height: 38px; }
  .install-banner-action {
    grid-column: 2 / 4;
    justify-self: start;
  }
}


/* v4.8 — resilient task drafts and autosave */
.task-save-state {
  min-width: 120px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  transition: color .18s ease, opacity .18s ease;
}
.task-save-state.saving { color: var(--gold); }
.task-save-state.saved { color: #94b79f; }
.task-save-state.draft { color: #c9ae73; }
.task-save-state.error { color: #e28f89; }
@media (max-width: 620px) {
  .task-modal-actions { flex-wrap: wrap; }
  .task-modal-actions .task-save-state { order: -1; width: 100%; }
}

/* v5.1 — persistent builder checklists, compact task cards and sidebar control alignment */
.sidebar .brand { padding-right: 48px; }
.sidebar-collapse-button,
.sidebar-reopen-button {
  min-width: 36px;
  min-height: 36px;
}
.sidebar-collapse-button {
  width: 36px;
  height: 36px;
  top: 20px;
  right: 12px;
  border-radius: 9px;
}
.sidebar-reopen-button {
  width: 36px;
  height: 44px;
}

.task-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.task-card-collapse-button {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #36413a;
  border-radius: 9px;
  background: rgba(10, 14, 12, .72);
  color: #aeb7b1;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
  transition: color .14s ease, border-color .14s ease, background .14s ease, transform .14s ease;
}
.task-card-collapse-button:hover,
.task-card-collapse-button:focus-visible {
  color: var(--gold-bright);
  border-color: rgba(200,164,92,.55);
  background: rgba(200,164,92,.08);
  outline: none;
}
.task-card-collapse-button:active { transform: scale(.94); }
.task-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #87928b;
  font-size: 10px;
}
.task-card-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-card-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #9ba69f;
  font-size: 9px;
}
.task-card-progress .progress-bar { height: 5px; }
.task-card-details {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows .18s ease, opacity .14s ease, margin-top .18s ease;
  margin-top: 10px;
}
.task-card-details > div { min-height: 0; overflow: hidden; }
.task-card.is-collapsed .task-card-details {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
}
.task-card.is-collapsed { padding-bottom: 12px; }
.task-card-notes { margin-top: 0 !important; }
.task-card-checklists {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(43,52,47,.72);
}
.task-card-checklist-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #8f9a93;
  font-size: 9px;
}
.task-card-checklist-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-card-checklist-row span:last-child { flex: 0 0 auto; }

.task-checklist-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}
.task-checklist-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.task-checklist-section-head h3 {
  margin: 4px 0 0;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}
.checklist-add-button { flex: 0 0 auto; }
.task-checklist-list { display: grid; gap: 10px; }
.checklist-empty-state {
  padding: 14px;
  border: 1px dashed #38433c;
  border-radius: 11px;
  background: rgba(9, 13, 11, .46);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.checklist-empty-state strong { color: #c8d0cb; }
.checklist-error-state {
  display: grid;
  gap: 3px;
  border-color: rgba(187,106,100,.5);
  color: #c6a19d;
}
.saved-checklist {
  border: 1px solid #344039;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(23,29,25,.96), rgba(13,17,15,.96));
  overflow: hidden;
}
.saved-checklist-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}
.checklist-number-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(200,164,92,.42);
  border-radius: 9px;
  background: rgba(200,164,92,.08);
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 18px;
}
.saved-checklist-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.saved-checklist-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e7ebe7;
  font-size: 12px;
  font-weight: 700;
}
.saved-checklist-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.saved-checklist-chevron { color: var(--gold); font-family: Georgia, serif; font-size: 18px; text-align: center; }
.saved-checklist-actions { display: flex; gap: 6px; }
.checklist-small-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #354038;
  border-radius: 8px;
  background: #111613;
  color: #adb7b0;
  cursor: pointer;
  font-size: 10px;
}
.checklist-small-button:hover { border-color: rgba(200,164,92,.5); color: var(--gold-bright); }
.checklist-small-button.danger:hover { border-color: rgba(187,106,100,.55); color: #e29892; }
.saved-checklist-progress {
  height: 4px;
  background: #222a25;
  overflow: hidden;
}
.saved-checklist-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8d7142, #d3b46e);
  transition: width .18s ease;
}
.saved-checklist-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .18s ease, opacity .14s ease;
}
.saved-checklist-body > div { min-height: 0; overflow: hidden; }
.saved-checklist.is-expanded .saved-checklist-body {
  grid-template-rows: 1fr;
  opacity: 1;
}
.saved-checklist-item {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-top: 1px solid rgba(43,52,47,.65);
  color: #c4cbc6;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.saved-checklist-item input,
.checklist-editor-checkbox {
  appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid #59655e;
  border-radius: 5px;
  background: #0d110f;
  cursor: pointer;
  position: relative;
}
.saved-checklist-item input:checked,
.checklist-editor-checkbox:checked {
  border-color: rgba(200,164,92,.78);
  background: rgba(200,164,92,.22);
}
.saved-checklist-item input:checked::after,
.checklist-editor-checkbox:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
}
.saved-checklist-item.is-complete span { color: #7f8a83; text-decoration: line-through; }
.checklist-empty-items { padding: 12px; color: var(--muted); font-size: 11px; }

.checklist-modal-backdrop { z-index: 65; }
.checklist-modal { width: min(760px, 100%); }
.checklist-modal-grid {
  display: grid;
  grid-template-columns: minmax(120px, .34fr) minmax(0, 1fr);
  gap: 14px;
}
.checklist-items-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #bac2bd;
  font-size: 12px;
  font-weight: 700;
}
.checklist-items-heading span:last-child { color: var(--muted); font-size: 10px; font-weight: 500; }
.checklist-editor-items { display: grid; gap: 8px; }
.checklist-editor-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 36px 36px;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid #354039;
  border-radius: 10px;
  background: rgba(10,14,12,.72);
  transition: border-color .14s ease, opacity .14s ease, transform .14s ease;
}
.checklist-editor-row.dragging { opacity: .35; }
.checklist-editor-row.drag-over { border-color: rgba(200,164,92,.72); transform: translateY(1px); }
.checklist-editor-text { padding: 8px 9px; }
.checklist-drag-handle,
.checklist-item-delete {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7f8a83;
  cursor: grab;
  font-size: 17px;
  letter-spacing: -5px;
}
.checklist-drag-handle:hover { color: var(--gold-bright); background: rgba(200,164,92,.07); }
.checklist-drag-handle:active { cursor: grabbing; }
.checklist-item-delete { cursor: pointer; color: #9b7773; font-size: 22px; letter-spacing: 0; }
.checklist-item-delete:hover { color: #e29892; background: rgba(187,106,100,.08); }
.checklist-add-item-button {
  min-height: 45px;
  border: 1px dashed rgba(200,164,92,.58);
  border-radius: 10px;
  background: rgba(200,164,92,.025);
  color: var(--gold-bright);
  cursor: pointer;
  font-weight: 700;
}
.checklist-add-item-button:hover { background: rgba(200,164,92,.08); }
.checklist-form-message {
  padding: 10px 12px;
  border: 1px solid rgba(187,106,100,.45);
  border-radius: 9px;
  background: rgba(187,106,100,.08);
  color: #e09a94;
  font-size: 11px;
}
.checklist-form-message.success {
  border-color: rgba(111,154,120,.45);
  background: rgba(111,154,120,.08);
  color: #9dcca8;
}

@media (max-width: 700px) {
  .task-checklist-section-head { align-items: stretch; flex-direction: column; }
  .checklist-add-button { width: 100%; }
  .saved-checklist-head { grid-template-columns: 36px minmax(0, 1fr); }
  .saved-checklist-main { grid-template-columns: minmax(0, 1fr) auto 22px; }
  .saved-checklist-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .checklist-modal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .saved-checklist-main { grid-template-columns: minmax(0, 1fr) 22px; }
  .saved-checklist-count { grid-column: 1; grid-row: 2; }
  .saved-checklist-chevron { grid-column: 2; grid-row: 1 / 3; }
  .checklist-editor-row { grid-template-columns: 22px minmax(0, 1fr) 34px 34px; gap: 6px; padding: 7px; }
  .checklist-drag-handle,
  .checklist-item-delete { width: 34px; height: 34px; }
}

/* v5.2.2 — keep every workflow column inside one continuous task board. */
.kanban {
  grid-template-columns: repeat(5, minmax(320px, 1fr));
  overflow-x: auto;
  overflow-y: visible;
  align-items: start;
  scroll-snap-type: x proximity;
  scrollbar-gutter: stable;
}
.kanban-column {
  min-width: 320px;
  scroll-snap-align: start;
}
.kanban-cards { align-content: start; }
.task-card {
  min-width: 0;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  padding: 14px;
}
.task-card.is-collapsed { min-height: 160px; }
.task-card h3 {
  margin: 10px 42px 8px 0;
  font-size: 14px;
  line-height: 1.42;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.task-card-top { min-height: 30px; }
.task-card-collapse-button {
  position: relative;
  flex-basis: 30px;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 8px;
}

.task-card-collapse-button::before {
  content: "";
  position: absolute;
  inset: -2px;
}
.task-card-collapse-button svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.task-card-summary {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 5px 12px;
  min-height: 16px;
}
.task-card-summary span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.task-card-owner { margin-left: auto; text-align: right; }
.task-deadline {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 8px;
  color: #87928b;
  font-size: 10px;
  line-height: 1.3;
}
.task-deadline svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.task-deadline.due-soon { color: #d2aa62; }
.task-deadline.overdue { color: #dc817a; }
.task-card-progress { margin-top: 8px; }
.task-card-details { margin-top: 9px; }
.task-card-details > div { padding-top: 1px; }
.task-card .task-card-notes {
  display: block;
  max-height: 118px;
  overflow: auto;
  padding-right: 5px;
  color: #8f9a93;
  font-size: 10px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}
.task-card.is-collapsed .task-card-details { pointer-events: none; }
.task-card.is-collapsed .task-card-progress { margin-top: 8px; }

.board-toolbar select { flex: 1 1 155px; max-width: 210px; }
.deadline-field { grid-column: 1 / -1; }
.deadline-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.deadline-clear-button {
  min-width: 68px;
  border: 1px solid #303a34;
  border-radius: 9px;
  background: #141a17;
  color: #aeb7b1;
  cursor: pointer;
  padding: 0 12px;
}
.deadline-clear-button:hover,
.deadline-clear-button:focus-visible {
  color: var(--gold-bright);
  border-color: rgba(200,164,92,.55);
  outline: none;
}
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .72; cursor: pointer; }

.sidebar-collapse-button {
  right: 10px;
  top: 18px;
  z-index: 5;
}
.sidebar .brand { padding-right: 54px; }

.history-intro { min-height: 150px; }
.history-category-tabs {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.history-category-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(16,20,18,.78);
  color: #aeb7b1;
  cursor: pointer;
  transition: .16s ease;
}
.history-category-tab span { color: #7f8a83; }
.history-category-tab:hover { border-color: #46534b; color: var(--text); }
.history-category-tab.active {
  color: var(--gold-bright);
  border-color: rgba(200,164,92,.42);
  background: rgba(200,164,92,.09);
}
.history-category-tab.active span { color: var(--gold-bright); }
.history-toolbar { margin-top: 16px; }
.history-toolbar .search { min-width: min(100%, 280px); }
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}
.history-task-card {
  min-width: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.history-task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.history-category-label { color: #8f9a93; font-size: 10px; }
.history-task-card h3 {
  margin: 13px 0 14px;
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.history-task-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.history-task-meta span {
  min-width: 0;
  color: #aeb7b1;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.history-task-meta strong {
  display: block;
  margin-bottom: 2px;
  color: #707b74;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.history-deadline { margin-top: 12px; }
.history-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}
.history-task-actions .compact-button { min-height: 34px; }
.history-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}
.history-pagination button:disabled { opacity: .42; cursor: default; }

.history-task-modal { width: min(820px, 100%); }
.history-task-modal-content { display: grid; gap: 18px; }
.history-modal-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 11px;
}
.history-modal-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.history-modal-metadata > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(43,52,47,.82);
  border-radius: 9px;
  background: rgba(9,13,11,.48);
}
.history-modal-metadata span {
  display: block;
  margin-bottom: 4px;
  color: #748078;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.history-modal-metadata strong {
  display: block;
  color: #c5ccc7;
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.history-modal-notes {
  padding: 14px;
  border: 1px solid rgba(43,52,47,.82);
  border-radius: 10px;
  background: rgba(9,13,11,.44);
}
.history-modal-notes > p:last-child {
  margin: 9px 0 0;
  max-height: 180px;
  overflow: auto;
  color: #9ba69f;
  font-size: 12px;
  line-height: 1.55;
}
.history-checklists { display: grid; gap: 10px; margin-top: 9px; }
.history-checklist {
  padding: 12px;
  border: 1px solid rgba(43,52,47,.82);
  border-radius: 10px;
  background: rgba(9,13,11,.4);
}
.history-checklist-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #c6cec8;
  font-size: 11px;
}
.history-checklist-head span { color: var(--muted); flex: 0 0 auto; }
.history-checklist-items { display: grid; gap: 6px; margin-top: 10px; }
.history-checklist-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  color: #a7b0aa;
  font-size: 11px;
  line-height: 1.4;
}
.history-checklist-item.completed { color: #77827b; text-decoration: line-through; }
.history-empty-checklists {
  margin-top: 9px;
  padding: 12px;
  border: 1px dashed #38433c;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 760px) {
  .kanban { grid-template-columns: 1fr; }
  .board-toolbar select { max-width: none; }
  .history-modal-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .task-card { min-height: 150px; }
  .task-card.is-collapsed { min-height: 150px; }
  .task-card h3 { margin-right: 24px; }
  .task-card-owner { margin-left: 0; text-align: left; }
  .deadline-input-row { grid-template-columns: 1fr; }
  .deadline-clear-button { min-height: 38px; }
  .history-task-meta,
  .history-modal-metadata { grid-template-columns: 1fr; }
  .history-task-actions > button { width: 100%; }
  .history-checklist-head { flex-direction: column; gap: 4px; }
}

/* v5.2.3 — use the full desktop width when the sidebar is collapsed. */
.page-root.task-board-page {
  width: 100%;
  max-width: none;
  padding-left: clamp(16px, 2vw, 36px);
  padding-right: clamp(16px, 2vw, 36px);
}

@media (min-width: 1600px) {
  .app-shell.sidebar-collapsed .page-root.task-board-page .kanban {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    scrollbar-gutter: auto;
  }
  .app-shell.sidebar-collapsed .page-root.task-board-page .kanban-column {
    min-width: 0;
  }
}



/* v5.3 — task project switcher and persistent search focus. */
.board-intro-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.task-project-control {
  display: grid;
  gap: 6px;
  justify-items: end;
}
.task-project-label,
.task-project-readonly > span {
  color: #7f8a83;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.task-project-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #334039;
  border-radius: 10px;
  background: #0d120f;
}
.task-project-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #89948d;
  cursor: pointer;
  padding: 7px 11px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.task-project-button:hover,
.task-project-button:focus-visible {
  border-color: #465149;
  color: #d4dcd6;
  outline: none;
}
.task-project-button.active {
  border-color: rgba(200,164,92,.48);
  background: rgba(200,164,92,.12);
  color: var(--gold-bright);
}
.task-project-readonly {
  min-width: 150px;
  display: grid;
  gap: 5px;
  padding: 8px 11px;
  border: 1px solid #334039;
  border-radius: 9px;
  background: #111713;
}
.task-project-readonly strong { color: #d7ddd9; font-size: 11px; }
.task-project-empty { border-color: rgba(200,164,92,.35); background: rgba(200,164,92,.045); }

@media (max-width: 900px) {
  .board-intro-actions { width: 100%; justify-content: stretch; }
  .task-project-control { width: 100%; justify-items: stretch; }
  .task-project-switcher { width: 100%; }
  .task-project-button { flex: 1 1 0; }
  .board-intro-actions .primary-button { width: 100%; }
}

@media (max-width: 460px) {
  .task-project-switcher { display: grid; grid-template-columns: 1fr; }
  .task-project-button { width: 100%; }
}


/* v5.3.1 — project Home screen and locked MMORPG early access. */
.project-home {
  width: min(1120px, 100%);
  margin: 24px auto 0;
}
.project-home-heading {
  max-width: 720px;
  margin-bottom: 24px;
}
.project-home-heading h2 {
  margin: 6px 0 10px;
  font-size: clamp(30px, 4vw, 48px);
}
.project-home-heading > p:last-child {
  max-width: 650px;
  color: var(--muted);
}
.project-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.project-choice-card {
  position: relative;
  min-width: 0;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #344039;
  border-radius: 18px;
  background: linear-gradient(155deg, #151d18 0%, #0d120f 100%);
  overflow: hidden;
}
.project-choice-card::after {
  content: '';
  position: absolute;
  inset: auto -70px -90px auto;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(200,164,92,.12);
  border-radius: 50%;
  pointer-events: none;
}
.project-choice-smp { border-color: rgba(200,164,92,.52); box-shadow: inset 3px 0 0 var(--gold); }
.project-choice-card.locked { border-color: #2c3430; background: linear-gradient(155deg, #141916 0%, #0b0f0d 100%); }
.project-choice-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.project-choice-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200,164,92,.55);
  border-radius: 14px;
  background: rgba(200,164,92,.08);
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}
.project-choice-card.locked .project-choice-mark { border-color: #3b443f; background: #131815; color: #89938d; }
.project-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.project-status.available { border-color: rgba(101,168,123,.48); background: rgba(101,168,123,.09); color: #9ed1ad; }
.project-status.early-access { border-color: rgba(200,164,92,.5); background: rgba(200,164,92,.09); color: var(--gold-bright); }
.project-status.locked { border-color: #3a433e; background: #111713; color: #87918b; }
.project-choice-copy { flex: 1; }
.project-choice-copy h3 { margin: 7px 0 12px; font-size: clamp(25px, 3vw, 36px); }
.project-choice-copy > p:last-child { color: #a9b2ac; line-height: 1.7; }
.project-choice-card.locked .project-choice-copy > p:last-child { color: #858f89; }
.project-choice-button { align-self: flex-start; min-width: 190px; }
.project-home-foot { width: min(1120px, 100%); margin-inline: auto; }
.task-project-context {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.task-project-context > div {
  min-width: 150px;
  display: grid;
  gap: 4px;
  padding: 8px 11px;
  border: 1px solid #354139;
  border-radius: 9px;
  background: #111713;
}
.task-project-context span {
  color: #7f8a83;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.task-project-context strong { color: #d7ddd9; font-size: 11px; }
.permission-row-single { grid-template-columns: minmax(0, 1fr) minmax(150px, auto); }
.project-permission-toggle { grid-column: auto; }
@media (max-width: 780px) {
  .project-home { margin-top: 10px; }
  .project-home-grid { grid-template-columns: 1fr; }
  .project-choice-card { min-height: 290px; }
  .project-choice-smp { order: 1; }
  .project-choice-mmorpg { order: 2; }
  .task-project-context { width: 100%; justify-content: stretch; }
  .task-project-context > * { flex: 1 1 auto; }
  .task-project-context > div { min-width: 0; }
  .permission-row-single { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .project-choice-card { padding: 22px; border-radius: 14px; }
  .project-choice-button { width: 100%; min-width: 0; }
}
