:root {
  color-scheme: light;
  --blue: #35133e;
  --blue-2: #55205f;
  --orange: #f15b2a;
  --lime: #c8e728;
  --teal: #008eb0;
  --cyan: #69c9df;
  --yellow: #f3ce24;
  --bg: #f6f8ef;
  --card: #ffffff;
  --text: #201727;
  --muted: #647076;
  --border: #d9dfc7;
  --danger: #a32020;
  --shadow: 0 12px 28px rgba(53, 19, 62, 0.10);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea { font: inherit; }

button,
.file-button {
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(241, 91, 42, 0.18);
}

button:hover,
.file-button:hover { filter: brightness(1.05); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary { background: #eef6cf; color: var(--blue); box-shadow: none; border: 1px solid #d4e978; }
button.tertiary { background: #eef9fc; color: #005e74; box-shadow: none; border: 1px solid #b6e5ef; }
button.danger { background: var(--danger); color: white; }
button.subtle { box-shadow: none; }
button.full { width: 100%; margin-bottom: .75rem; }
.hidden { display: none !important; }

.hidden-file-input {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.app-header {
  background: linear-gradient(135deg, var(--blue), #211026 58%, #082f3a);
  color: white;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,.16);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.brand-logo {
  width: min(260px, 34vw);
  max-height: 112px;
  object-fit: contain;
  background: white;
  border: 3px solid var(--cyan);
  border-radius: 8px;
  padding: .35rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.app-header h1 { margin: .15rem 0; font-size: 2.1rem; }
.app-header .muted { color: rgba(255,255,255,.74); }
.header-actions { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: flex-end; }
.app-header button.secondary { background: rgba(200,231,40,.16); color: white; border: 1px solid rgba(200,231,40,.42); }

.eyebrow {
  margin: 0;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  color: var(--lime);
}

.muted { color: var(--muted); }
.small { font-size: .86rem; line-height: 1.35; }

.layout {
  display: grid;
  grid-template-columns: minmax(250px, 340px) 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  max-width: 1500px;
  margin: 0 auto;
}

.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.card h2 { margin: 0 0 1rem; color: var(--blue); }
.compact-card { position: sticky; top: 124px; }
.hero-card { border-top: 5px solid var(--lime); }
.document-type-field {
  max-width: 420px;
  margin-bottom: 1rem;
}

.hero-row,
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .4rem .8rem;
  background: #fff1e8;
  color: #973812;
  font-weight: 800;
  white-space: nowrap;
}

.pill.saved { background: #eef6cf; color: #3b4c00; }

.grid { display: grid; gap: .95rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.field span {
  font-weight: 800;
  color: #28394b;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem .85rem;
  background: #fbfdff;
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(0, 142, 176, .18);
  border-color: var(--teal);
}

.field textarea { resize: vertical; }
.full-field { grid-column: 1 / -1; }

.item-card {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(220px, 1fr);
  gap: .8rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .95rem;
  margin-bottom: .8rem;
  background: linear-gradient(180deg, #ffffff, #fbfff0);
}

.item-title {
  font-weight: 900;
  color: var(--blue);
  padding-top: .62rem;
}

.item-control {
  min-width: 0;
}

.displayed-wording {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8e87b;
  border-radius: 8px;
  background: #fbfff0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.displayed-wording-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #334155;
}

.displayed-wording-row + .displayed-wording-row {
  margin-top: 6px;
}

.displayed-wording-row strong {
  color: #111827;
}

.draft-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .45rem;
  align-items: stretch;
}

.draft-button {
  text-align: left;
  background: #fbfff0;
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
  display: block;
}

.draft-delete-button {
  align-self: stretch;
  padding-inline: .75rem;
}

.draft-button strong {
  display: block;
  color: var(--blue);
}

.draft-button small {
  display: block;
  color: var(--muted);
  margin-top: .2rem;
}

.storage-status,
.status-box {
  border-radius: 8px;
  background: #fbfff0;
  border: 1px solid var(--border);
  padding: .75rem;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1rem;
}

.status-box:empty { display: none; }

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-tools {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .75rem;
}

.photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8eef5;
}

.photo-card-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.photo-card-actions button {
  padding: .55rem .7rem;
  font-size: .85rem;
}

.remote-area {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfdff;
}

.bottom-actions-card {
  border-top: 5px solid var(--lime);
  margin-bottom: 2rem;
}

.bottom-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.bottom-actions button {
  min-height: 52px;
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: .85rem; }
  .app-header { position: static; align-items: flex-start; flex-direction: column; }
  .brand-block { align-items: flex-start; flex-direction: column; }
  .brand-logo { width: min(300px, 100%); max-height: 128px; }
  .app-header h1 { font-size: 1.9rem; }
  .header-actions { justify-content: flex-start; }
  .compact-card { position: static; }
  .item-card { grid-template-columns: 1fr; }
  .item-title { padding-top: 0; }
  .grid.two { grid-template-columns: 1fr; }
  .bottom-actions { grid-template-columns: 1fr; }
  .bottom-actions-card { margin-bottom: 5rem; }
}
