.wrap { width: 100%; max-width: 980px; }
section, .card, .field, .row > *, .table-wrap, .brief-body { min-width: 0; max-width: 100%; }
h1, h2, h3, p, span, td, th, li, strong, code { overflow-wrap: anywhere; }
.flush { margin-top: 0; }
.sub-h { font-size: 16px; margin: 14px 0 8px; }
.top-gap { margin-top: 16px; }
.card { margin-bottom: 20px; }

button, .btn, label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

input:not([type="file"]):not([type="hidden"]), select, textarea {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
}

input[type="date"] {
  width: 100%;
  min-width: 0;
}

.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.field-wide {
  grid-column: 1 / -1;
}

.err-msg {
  color: var(--warn);
  font-weight: 600;
  margin: 8px 0;
}

.warn-box {
  background: var(--chip);
  border: 1px solid var(--warn);
  color: var(--warn);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.card-list, .chip-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.card-list li {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.item-title {
  font-weight: 700;
  font-size: 16px;
  flex: 1 1 150px;
}

.item-meta {
  font-size: 14px;
  color: var(--muted);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.item-actions select {
  width: auto;
  flex: 1 1 130px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list li {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 6px 4px 12px;
  max-width: 100%;
}

.feat-label {
  font-weight: 600;
  font-size: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 8px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.matrix-table th, .matrix-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.matrix-table thead th {
  background: var(--chip);
  font-weight: 700;
}

.matrix-table tbody tr:last-child th,
.matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.col-yours {
  background: var(--chip);
  font-weight: 600;
}

.num-mono {
  font-family: var(--mono);
}

.badge-yes {
  background: var(--accent);
  color: var(--accent-ink);
}

.badge-partial {
  border: 1px solid var(--field-line);
}

.badge-no {
  color: var(--warn);
  border: 1px solid var(--warn);
}

.progress-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 92px), 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-box strong {
  font-size: 18px;
  font-family: var(--mono);
}

.progress-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

.bar-track { fill: var(--line); }
.bar-live { fill: var(--accent); }
.pat-sub-bg { fill: var(--chip); }
.pat-sub-fg { stroke: var(--accent); }
.bar-declined { fill: var(--warn); }

.legend-line {
  margin: 8px 0 0;
}

.brief-head {
  margin-bottom: 8px;
}

.brief-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.brief-block h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.brief-ul {
  margin: 6px 0 0;
  padding-inline-start: 20px;
}

.brief-ul li {
  margin-bottom: 4px;
  font-size: 14px;
}

code {
  font-family: var(--mono);
  font-size: 13px;
}

@media print {
  .no-print, header.top, footer { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: 100%; padding: 0; }
  .card { border: none; padding: 0; margin: 0; }
  section[hidden] { display: none !important; }
}
