:root {
  --bg: #eef3fb;
  --surface: #ffffff;
  --primary: #2f80ed;
  --primary-dark: #1f5fb6;
  --text: #1c2b40;
  --muted: #667085;
  --border: #d9e2f1;
  --success: #1f9d55;
  --danger: #d64545;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); line-height: 1.45; }
.container { width: min(760px, 92vw); margin: 0 auto; }
.app-bar { background: linear-gradient(145deg, #2f80ed, #67a6ff); color: #fff; position: sticky; top: 0; z-index: 5; box-shadow: 0 3px 18px rgba(9, 30, 66, .2); }
.app-bar-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; font-size: 1.02rem; }
.app-brand { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #eaf4ff; box-shadow: 0 0 0 4px rgba(255,255,255,.2); }
.app-caption { opacity: .9; font-size: .76rem; }
.main-content { padding: 16px 0 calc(96px + env(safe-area-inset-bottom)); }
.card { background: var(--surface); border-radius: 18px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(16, 24, 40, .06); }
h1, h2, h3 { margin-top: 0; }
.card, .card * { max-width: 100%; }
.card p, .card strong, .card small, .card h1, .card h2, .card h3, .card td, .card th, .card label, .card span {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.muted { color: var(--muted); font-size: .94rem; }
.form-grid { display: grid; gap: 10px; }
label { font-size: .92rem; color: var(--text); display: grid; gap: 6px; min-width: 0; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 13px; min-height: 50px; padding: 12px 13px; background: #fff; font-size: 16px; }
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 50%;
  flex: 0 0 18px;
}
textarea { min-height: 110px; resize: vertical; }
.btn { min-height: 48px; padding: 10px 16px; border-radius: 12px; border: none; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.sticky-actions { position: sticky; bottom: 8px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); display: flex; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--border); }
.sticky-actions .btn { flex: 1; }
.progress { height: 10px; background: #e8eef8; border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #2f80ed, #63a7ff); }
.progress-meta { display:flex; justify-content: space-between; font-size:.85rem; color:var(--muted); margin-bottom:8px; }
.progress-note { margin: 8px 0 0; }
.option-group, .score-group { display: grid; gap: 8px; }
.option-group label, .score-group label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
}
.option-group label input,
.score-group label input { margin-top: 2px; flex: 0 0 auto; }
.option-group label,
.score-group label {
  white-space: normal;
  overflow-wrap: anywhere;
}
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; table-layout: fixed; }
th, td { border: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; min-width: 0; }
.input-table input { min-height: 40px; max-width: 100%; }
.alert { padding: 10px 12px; border-radius: 10px; }
.error { color: #7f1d1d; background: #ffe4e6; }
.success { color: #14532d; background: #dcfce7; }
.error-text { color: var(--danger); min-height: 16px; font-size: .82rem; }
.field-invalid { border-color: #d64545 !important; box-shadow: 0 0 0 3px rgba(214,69,69,.15); }
.badge { display:inline-flex; padding:4px 8px; border-radius:999px; font-size:.74rem; font-weight:600; text-transform:capitalize; }
.badge-draft { background:#fff4d6; color:#8a5b00; }
.badge-submitted { background:#dcfce7; color:#166534; }
.badge-reviewed { background:#dbeafe; color:#1e40af; }
.badge-archived { background:#e5e7eb; color:#374151; }
.stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.stats-grid article { border:1px solid var(--border); border-radius:12px; padding:12px; text-align:center; }
.review-item { border-top: 1px dashed var(--border); padding: 8px 0; }
.center { text-align: center; }
.submission-code { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.success-actions { display: grid; gap: 10px; margin-top: 14px; }
.inline-form { display:inline; }
.link-btn { border:0; background:none; color:#b42318; text-decoration:underline; cursor:pointer; padding:0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill { display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; background:#eef5ff; border:1px solid #d4e4ff; color:#1d4f91; font-size:.78rem; }
.autosave-text { display: block; margin-top: 6px; text-align: right; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); background: #102a43; color: #fff; border-radius: 999px; padding: 9px 14px; font-size: .82rem; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; }
.review-head { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.list-compact { display: grid; gap: 10px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.list-row p { margin: 2px 0 0; }
@media (min-width: 768px) {
  .main-content { padding-top: 20px; }
  .option-group { grid-template-columns: 1fr 1fr; }
}

