:root {
  --ink: #0f1715;
  --ink-2: #26342f;
  --muted: #66736d;
  --line: #d7ded8;
  --line-strong: #bdc9c0;
  --paper: #eef2ef;
  --surface: #ffffff;
  --surface-2: #f7f9f6;
  --field: #fbfcfa;
  --green: #176b4a;
  --green-dark: #0e2f25;
  --blue: #235d7e;
  --gold: #a96920;
  --rose: #a8463d;
  --shadow: 0 24px 70px rgba(15, 23, 21, 0.12);
  --body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(14, 47, 37, 0.08), transparent 280px),
    radial-gradient(circle at 12% 0, rgba(35, 93, 126, 0.12), transparent 340px),
    var(--paper);
}

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

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 44px);
  color: #edf5f0;
  background: rgba(14, 23, 21, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 178px;
  min-height: 42px;
}

.brand img {
  width: 100%;
  height: auto;
}

.topbar-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: rgba(237, 245, 240, 0.62);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-meta strong {
  color: #fff;
}

.shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 28px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

.intro-copy {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.operating-rule {
  border-left: 4px solid var(--gold);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.72);
}

.operating-rule span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.operating-rule strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.request-form {
  min-width: 0;
}

.form-section,
.summary-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.form-section {
  margin: 0;
  padding: clamp(18px, 3vw, 28px);
}

.form-section legend {
  float: left;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
}

.form-section legend + * {
  clear: both;
}

.field-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field + .field,
.field-grid + .field-grid,
.field-grid + .field,
.field + .field-grid {
  margin-top: 14px;
}

.field > span,
.request-type-field > span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--field);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input,
select {
  min-height: 48px;
  padding: 0 13px;
}

textarea {
  min-height: 104px;
  padding: 13px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35, 93, 126, 0.13);
}

::placeholder {
  color: #8d9892;
}

.request-type-field {
  margin-top: 16px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.type-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.type-option:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-option span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.type-option:has(input:checked) {
  border-color: var(--green);
  color: var(--green-dark);
  background: #eaf5ef;
  box-shadow: inset 0 0 0 1px rgba(23, 107, 74, 0.2);
}

.evidence-field {
  margin-top: 14px;
}

.evidence-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 96px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #f7faf7;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.evidence-dropzone:hover,
.evidence-dropzone:focus,
.evidence-dropzone.is-active {
  border-color: var(--green);
  background: #eef8f2;
  box-shadow: 0 0 0 3px rgba(23, 107, 74, 0.1);
}

.evidence-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.evidence-dropzone strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 14px;
}

.evidence-dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.compact-upload-button {
  min-width: 120px;
  min-height: 40px;
}

.attachment-list {
  display: none;
  gap: 8px;
  margin-top: 10px;
}

.attachment-list.has-attachments {
  display: grid;
}

.attachment-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.attachment-item img {
  width: 54px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}

.attachment-item strong,
.attachment-item span {
  display: block;
}

.attachment-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item span {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.attachment-item button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.summary-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.summary-head {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.summary-head strong {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.next-steps {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.next-steps div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.35;
}

.next-steps div:last-child {
  border-bottom: 0;
}

.next-steps span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.hidden-summary {
  display: none;
}

.action-grid {
  display: grid;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button.primary {
  color: #fff;
  background: var(--green-dark);
  box-shadow: 0 14px 26px rgba(14, 47, 37, 0.22);
}

.button.secondary {
  color: #fff;
  background: var(--blue);
}

.button.ghost {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
}

.button.quiet {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}

.submit-status {
  display: none;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}

.submit-status:not(:empty) {
  display: block;
}

.submit-status.pending {
  border-left-color: var(--blue);
  background: #edf6fa;
}

.submit-status.success {
  border-left-color: var(--green);
  background: #edf8f2;
}

.submit-status.warning {
  border-left-color: var(--gold);
  background: #fff7eb;
}

.submit-status.error {
  border-left-color: var(--rose);
  background: #fff1ef;
}

.backup-details {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.backup-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.backup-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 980px) {
  .intro,
  .workspace {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 16px;
  }

  .topbar-meta {
    align-items: flex-end;
    flex-direction: column;
    gap: 3px;
    margin-left: auto;
    text-align: right;
  }

  .field-grid.two,
  .type-grid {
    grid-template-columns: 1fr;
  }

  .evidence-dropzone {
    grid-template-columns: 1fr;
  }

  .compact-upload-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding-top: 22px;
  }

  h1 {
    font-size: 38px;
  }

  .intro-copy {
    font-size: 16px;
  }

  .brand {
    width: 142px;
  }
}
