/* Buttons, chips, controls, mock app frame, modal, drawer */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 550; cursor: pointer; transition: all .15s;
  text-decoration: none; line-height: 1.3;
}
.btn:hover { border-color: #b9bfcc; background: #f8f9fb; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #4b4be0; }
.btn.dark { background: #1d2030; border-color: #1d2030; color: #fff; }
.btn.danger { color: var(--red); border-color: #f1c4c4; background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: #f0f1f5; color: var(--text); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.sol { background: var(--sol); border-color: var(--sol); color: #fff; }
.btn.copied { background: var(--green-soft); border-color: #a9dcbc; color: var(--green); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--green); background: var(--green-soft); border-color: #bfe5cd; }
.chip.warn { color: var(--amber); background: var(--amber-soft); border-color: #f2d9a8; }
.chip.bad { color: var(--red); background: var(--red-soft); border-color: #f2c2c2; }
.chip.info { color: var(--s1); background: var(--s1-soft); border-color: #c6d8fb; }
.chip.neutral { color: var(--muted); background: #f0f1f5; border-color: var(--border); }
.chip.plain::before { display: none; }
.rid { font-family: var(--mono); font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: #f0f1f5; color: var(--text); border: 1px solid var(--border); }
.sol-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; color: #fff; background: var(--sol); }
.status { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; }
.status.OPEN { color: var(--red); background: var(--red-soft); }
.status.PARTIAL { color: var(--amber); background: var(--amber-soft); }
.status.FIXED { color: var(--green); background: var(--green-soft); }

.seg { display: inline-flex; background: #eef0f4; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; font-weight: 550; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.scenario { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; background: #fff; border: 1px dashed var(--border-strong); border-radius: 10px; }
.scenario .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 650; }

input[type=text], textarea, select { font-family: inherit; font-size: 13.5px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--text); width: 100%; }
textarea { resize: vertical; min-height: 70px; }
input:focus, textarea:focus, [contenteditable]:focus { outline: 2px solid rgba(91, 91, 240, .35); outline-offset: 1px; }

.progress { height: 8px; background: #e9ebf0; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--sol, var(--brand)); border-radius: 99px; transition: width .35s ease; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mock theStacc app frame */
.app { display: grid; grid-template-columns: 200px 1fr; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); min-height: 420px; position: relative; }
.app-side { border-right: 1px solid var(--border); padding: 12px 10px; display: flex; flex-direction: column; gap: 1px; background: #fff; font-size: 13px; }
.app-logo { font-family: var(--mono); color: var(--brand); font-weight: 600; padding: 2px 6px 10px; font-size: 14px; }
.app-proj { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 7px 9px; margin-bottom: 8px; font-weight: 600; font-size: 12.5px; }
.app-proj .av { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, #5b5bf0, #8fa2ff); }
.app-proj .caret { margin-left: auto; color: var(--faint); }
.app-group { font-size: 11.5px; color: var(--muted); padding: 9px 7px 3px; font-weight: 550; }
.app-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: #303546; }
.app-item svg { width: 15px; height: 15px; flex: none; stroke: #5e6577; }
.app-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.app-item.on svg { stroke: var(--brand); }
.app-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; font-size: 12px; }
.app-foot .plans { color: var(--brand); font-weight: 600; padding: 4px 8px; }
.app-foot .who { padding: 6px 8px; color: var(--muted); line-height: 1.35; }
.app-foot .who b { color: var(--text); display: block; font-size: 12.5px; }
.app-main { background: var(--bg); padding: 18px; position: relative; overflow: hidden; }
.app-main .page-title { font-size: 17px; font-weight: 650; margin-bottom: 2px; }
.app-main .page-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }

/* Modal and drawer (scoped to a container) */
.scrim { position: absolute; inset: 0; background: rgba(22, 26, 38, .38); display: grid; place-items: center; z-index: 20; padding: 18px; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 100%; overflow: auto; padding: 22px; }
.modal h4 { font-size: 17px; margin-bottom: 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 360px; max-width: 92%; background: #fff; border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 25; padding: 18px; overflow: auto; transform: translateX(105%); transition: transform .25s ease; }
.drawer.open { transform: none; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.kbd { font-family: var(--mono); font-size: 11.5px; background: #f3f4f7; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }

@media (max-width: 820px) {
  .chip { white-space: normal; }
  .ready-row { flex-wrap: wrap; }
  .app-main { padding: 12px; }
  .app { grid-template-columns: 1fr; }
  .app-side { display: none; }
}
