:root {
  --bg: #efe8dc;
  --paper: #fffdf8;
  --ink: #1c2420;
  --muted: #5c675f;
  --line: #e4ddd2;
  --brand: #1b6b57;
  --brand-deep: #0f3f34;
  --brand-soft: #e4f3ee;
  --amber: #9a4a0a;
  --amber-bg: #fff6e5;
  --red: #b42318;
  --red-bg: #fef3f2;
  --green: #157a4b;
  --green-bg: #eaf8f0;
  --shadow: 0 1px 2px rgba(28, 36, 32, 0.04), 0 8px 24px rgba(28, 36, 32, 0.06);
  --radius: 16px;
  --tap: 52px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 450;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  cursor: default;
}

/* ===== header ===== */
.app-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}

.app-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--brand);
  display: grid;
  place-items: center;
}

.header-copy {
  min-width: 0;
  flex: 1;
}

.header-copy h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--brand-deep);
}

.header-copy p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.sample-pill {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff4d6;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #f0d48a;
}

.back-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  background: var(--bg);
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 0;
}

/* ===== main ===== */
.main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

/* ===== branches ===== */
.branch-card { padding: 10px 12px 8px; }

.branch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.branch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #faf8f3;
  text-align: left;
}

.branch-item.is-current {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.branch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c5beb3;
  flex: 0 0 auto;
}

.branch-item.is-current .branch-dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(27, 107, 87, 0.18);
}

.branch-name {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.branch-name strong {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

.branch-name span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.branch-tag {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}

.branch-hint {
  margin: 6px 2px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 14px;
  border-radius: 14px;
  border: 0;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  width: 100%;
}

.btn svg { flex: 0 0 auto; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--brand-deep);
  border: 1.5px solid #c8d9d3;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--line);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-download {
  background: var(--green);
  color: #fff;
}

.btn-copy {
  background: #fff;
  color: var(--red);
  border: 1.5px solid #f0c8c4;
}

.btn-row {
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
}

.btn-new-branch {
  margin-top: 6px;
}

/* ===== files ===== */
.files-card { padding: 4px 8px 6px; flex: 0 0 auto; display: flex; flex-direction: column; }

.files-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 8px 6px;
}

.files-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.files-head em {
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
  color: #8a938c;
}

.file-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: 10px;
  text-align: left;
}

.file-row.is-folder { font-weight: 700; }

.file-row.is-file { padding-left: 28px; }

.file-row.is-file.depth-2 { padding-left: 44px; }

.file-row.is-folder.depth-1 { padding-left: 28px; }

.file-row.is-active {
  background: var(--brand-soft);
}

.file-ico { flex: 0 0 auto; display: grid; place-items: center; }

.file-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0;
}

.file-meta strong {
  font-size: 14px;
  font-weight: 700;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.file-meta span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.merge-cta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.merge-cta .btn {
  width: auto;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
}

.merge-cta p {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.35;
}

/* ===== bottom nav ===== */
.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 6px 10px 16px;
  gap: 6px;
}

.tab {
  min-height: 52px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  padding: 4px 8px;
}

.tab.is-active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.tab svg { display: block; }

/* ===== editor ===== */
.file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 2px;
}

.file-chip strong {
  font-size: 15px;
  font-weight: 750;
}

.file-chip span {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.hint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff6e5;
  border: 1.5px dashed #e2b657;
  color: #8a5a00;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 750;
  min-height: 44px;
}

.editor-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #1c2420;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #2a3530;
}

.editor-wrap pre {
  margin: 0;
  padding: 14px 14px 16px;
  color: #e8efe9;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.editor-wrap .kw { color: #8bd4b8; }
.editor-wrap .cm { color: #9aa89f; }
.editor-wrap .st { color: #f0c56e; }
.editor-wrap .fn { color: #c5e0ff; }

.paste-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px 16px;
  color: #d7ddd8;
}

.paste-empty strong {
  font-size: 16px;
  font-weight: 750;
  color: #fff;
}

.paste-empty span {
  font-size: 13px;
  font-weight: 600;
  color: #b5c0b8;
  max-width: 260px;
  line-height: 1.45;
}

/* ===== builds ===== */
.build-list.is-tight { flex: 0 0 auto; }

.build-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  align-content: start;
}

.build-card {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.build-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.build-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.build-card.is-running .build-icon { background: var(--amber-bg); }
.build-card.is-ok .build-icon { background: var(--green-bg); }
.build-card.is-fail .build-icon { background: var(--red-bg); }

.build-copy { min-width: 0; flex: 1; }

.build-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.build-card.is-running .build-copy strong { color: var(--amber); }
.build-card.is-ok .build-copy strong { color: var(--green); }
.build-card.is-fail .build-copy strong { color: var(--red); }

.build-copy span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.build-note {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #f3e3c0;
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 62%;
  background: linear-gradient(90deg, #d97706, #f5b342);
  border-radius: 999px;
}

.error-box {
  background: #fff;
  border: 1px solid #f0c8c4;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #7a1f18;
  white-space: pre-wrap;
}

/* ===== merge ===== */
.merge-lead {
  margin: 0;
  padding: 2px 2px 0;
}

.merge-lead h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}

.merge-lead p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
}

.merge-lead b { color: var(--ink); font-weight: 800; }

.change-card { padding: 8px 10px 10px; }

.change-card h3 {
  margin: 0;
  padding: 8px 6px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.change-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 6px 8px;
  border-radius: 10px;
}

.change-row + .change-row { border-top: 1px solid #f3eee6; }

.change-row strong {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-kind {
  font-size: 12px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 999px;
}

.change-kind.is-edit {
  background: #eef3ff;
  color: #3347a0;
}

.change-kind.is-new {
  background: var(--green-bg);
  color: var(--green);
}

.merge-warn {
  margin: 0;
  padding: 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.45;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.merge-warn svg { flex: 0 0 auto; margin-top: 2px; }

body.is-merge .main {
  padding-bottom: 8px;
}

/* ===== connect / repos / publish (06–08) ===== */
.field {
  display: grid;
  gap: 6px;
}

.field > span,
.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.field-input {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  width: 100%;
}

.field-input.is-masked {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.field-input svg { flex: 0 0 auto; color: var(--muted); }

.secure-note {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--brand-deep);
  line-height: 1.4;
  background: var(--brand-soft);
  border-radius: 12px;
}

.secure-note svg { flex: 0 0 auto; margin-top: 1px; }

.guide-card { padding: 10px 12px 8px; }

.guide-card h2 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.step {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid #f3eee6;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.steps .step:first-child { border-top: 0; padding-top: 2px; }

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.perm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.perm {
  font-size: 11px;
  font-weight: 750;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f4efe6;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 14px;
  font-weight: 750;
  width: 100%;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.connected-card {
  padding: 14px 12px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.connected-card .build-icon {
  margin: 0 auto;
  width: 44px;
  height: 44px;
}

.connected-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-deep);
}

.connected-card p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
}

.account-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsl(160 40% 82%);
  color: hsl(160 40% 22%);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  flex: 0 0 auto;
}

.account-row .file-meta strong { font-size: 15px; }

/* repo picker */
.switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  width: auto;
  max-width: 100%;
}

.switcher-btn strong {
  font-size: 16px;
  font-weight: 750;
  color: var(--brand-deep);
  line-height: 1.2;
}

.repo-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  display: grid;
  gap: 4px;
}

.repo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: left;
}

.repo-row.is-current { background: var(--brand-soft); }

.repo-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #f4efe6;
}

.badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.3;
}

.badge.is-apk {
  background: var(--green-bg);
  color: var(--green);
}

.badge.is-web {
  background: #eef3ff;
  color: #3347a0;
}

.repo-foot {
  margin: 0;
  padding: 4px 4px 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
}

.repo-foot .logout-link {
  display: inline;
  min-height: 0;
  padding: 0;
  width: auto;
  font-size: 12px;
}

/* new-project sheet */

.sheet-dim {
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 32, 0.45);
  z-index: 40;
  display: flex;
  align-items: flex-end;
}

.sheet {
  width: 100%;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 10px 16px 22px;
  box-shadow: 0 -8px 32px rgba(28, 36, 32, 0.16);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #ddd6cb;
  margin: 2px auto 10px;
}

.sheet h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-deep);
  text-align: center;
}

.type-pick {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.type-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #faf8f3;
  text-align: left;
  width: 100%;
}

.type-opt.is-on {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.type-opt .file-meta span { display: block; }

/* output toggle */
.out-box {
  padding: 10px 12px;
}

.out-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #f4efe6;
  border-radius: 14px;
}

.out-opt {
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
}

.out-opt small {
  font-size: 11px;
  font-weight: 650;
  color: #8a938c;
}

.out-opt.is-on {
  background: var(--paper);
  color: var(--brand-deep);
  box-shadow: 0 1px 3px rgba(28, 36, 32, 0.08);
}

.out-opt.is-on small { color: var(--muted); }

.live-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4efe6;
  color: var(--brand-deep);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  word-break: break-all;
}

.btn-row.is-split {
  grid-template-columns: 1fr 1fr;
}

.btn-row.is-split .btn { width: 100%; }

.btn-open {
  background: var(--green);
  color: #fff;
}

.btn-copylink {
  background: #fff;
  color: var(--brand-deep);
  border: 1.5px solid #c8d9d3;
}


/* ===== real app shell ===== */
html, body { height: 100%; }
body { overscroll-behavior-y: none; }
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg);
}
.app-header { position: sticky; top: 0; z-index: 20; }
.main { overflow: visible; padding-bottom: 96px; }
.main.no-tabs { padding-bottom: 24px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 760px; margin: 0 auto;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
button, a.btn, .repo-row, .file-row.is-clickable, .branch-item.is-clickable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a.btn { text-decoration: none; box-sizing: border-box; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .tab:focus-visible, .field-input:focus-visible, .repo-row:focus-visible, .file-row:focus-visible { outline: 3px solid #86c9b4; outline-offset: 2px; }
.btn-sm { min-height: 44px; padding: 8px 12px; font-size: 14px; width: auto; }
.btn-text {
  background: transparent; border: 0; color: var(--brand); font-weight: 750;
  text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 8px 4px; width: auto;
}
.header-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; overflow: hidden; background: var(--brand-soft); color: var(--brand-deep); font-weight: 800; }
.avatar-btn img, .account-av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.account-av { overflow: hidden; }
.switcher-btn { cursor: pointer; }
.switcher-btn strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

input.field-input, textarea.field-input, select.field-input { appearance: none; outline: none; }
input.field-input:focus, textarea.field-input:focus { border-color: var(--brand); }
.field-input.has-btn { padding-right: 6px; }
.field-input input { border: 0; outline: 0; background: transparent; font: inherit; flex: 1; min-width: 0; color: inherit; letter-spacing: inherit; }
.eye-btn { border: 0; background: var(--bg); border-radius: 10px; min-height: 40px; padding: 0 10px; font-size: 13px; font-weight: 750; color: var(--muted); }
.field-help { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }

.code-area {
  flex: 1 1 auto; width: 100%; min-height: 52dvh; resize: vertical;
  background: #1c2420; color: #e8efe9; border: 1px solid #2a3530; border-radius: 14px;
  padding: 14px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px; line-height: 1.55; tab-size: 2; white-space: pre; overflow: auto;
}
.code-area::placeholder { color: #9aa89f; white-space: pre-wrap; }
.code-area:focus { outline: 3px solid #86c9b4; outline-offset: 1px; }
.hint-bar { justify-content: space-between; }
.hint-bar .btn-sm { background: #fff; border: 1.5px solid #e2b657; color: #8a5a00; min-height: 38px; }

.notice { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 650; line-height: 1.45; }
.notice.is-error { background: var(--red-bg); color: var(--red); border: 1px solid #f0c8c4; }
.notice.is-ok { background: var(--green-bg); color: var(--green); border: 1px solid #bfe6cf; }
.notice.is-warn { background: var(--amber-bg); color: var(--amber); border: 1px solid #f0d48a; }
.notice.is-info { background: var(--brand-soft); color: var(--brand-deep); }
.notice a { color: inherit; font-weight: 800; }

.empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; color: var(--muted); font-weight: 650; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid #d8e7e1; border-top-color: var(--brand); animation: spin .8s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.build-icon .spin { border-color: #f3e3c0; border-top-color: #b45309; }
.progress.is-indet > i { width: 40%; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 90;
  background: #1c2420; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px); text-align: center;
}
.sheet { max-width: 760px; margin: 0 auto; max-height: 92dvh; overflow: auto; }
.sheet p.sheet-text { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.5; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 6px 2px; }
.toggle-row strong { font-size: 14px; font-weight: 750; display: block; }
.toggle-row span { font-size: 12px; font-weight: 600; color: var(--muted); display: block; }
.switch { position: relative; width: 52px; height: 32px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d6cfc4; transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(20px); }

.out-toggle.is-3 { grid-template-columns: repeat(3, 1fr); }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt { position: relative; }
.badge.is-none { background: #f1ede6; color: var(--muted); }
.search-input { min-height: 46px; }
.section-title { margin: 6px 2px 0; font-size: 15px; font-weight: 800; color: var(--brand-deep); }
.ai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ai-btn { flex-direction: column; gap: 4px; min-height: 76px; font-size: 14px; }
.ai-btn small { font-size: 11px; font-weight: 650; color: var(--muted); }
.prompt-box { white-space: pre-wrap; font-size: 12px; line-height: 1.5; background: #f4efe6; border-radius: 10px; padding: 10px 12px; max-height: 220px; overflow: auto; margin: 0; font-family: inherit; color: var(--ink); }
details.more { padding: 4px 12px; }
details.more summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 750; color: var(--brand-deep); cursor: pointer; }
details.more ol, details.more p { margin: 0 0 10px; padding-left: 20px; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.55; }
details.more p { padding-left: 0; }
.file-row.is-clickable:hover, .repo-row:hover { background: #f6f2ea; }
.repo-row.is-current:hover { background: var(--brand-soft); }
.branch-item.is-clickable { width: 100%; font: inherit; }
.change-kind.is-del { background: var(--red-bg); color: var(--red); }
.row-actions { display: flex; gap: 8px; }
.row-actions .btn { flex: 1; }
.error-box { max-height: 260px; overflow: auto; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 700px) {
  .main { padding-left: 20px; padding-right: 20px; }
  .code-area { min-height: 60vh; }
}
.plain-btn { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; }
.repo-row.plain-btn.is-current { background: var(--brand-soft); }
.row-badges { display: flex; gap: 4px; flex: 0 0 auto; }
.build-card .btn-text { justify-self: center; }

.sys-files { margin: 4px 0 2px; border-top: 1px solid #f3eee6; }
.sys-files summary { min-height: 44px; display: flex; align-items: center; padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
