:root {
  color-scheme: light;
  --ink: #18211c;
  --muted: #637068;
  --line: #d9ded6;
  --panel: #ffffff;
  --field: #f7f8f5;
  --brand: #2f6b4f;
  --brand-dark: #214c39;
  --accent: #c58d3f;
  --wash: #eef2eb;
  --danger: #9f2f24;
  --shadow: 0 24px 70px rgba(24, 33, 28, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.admin-shell {
  min-height: 100vh;
  padding: 24px;
}

.signin-view {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: stretch;
  width: min(100%, 1080px);
  margin: 0 auto;
}

.brand-block,
.signin-card,
.tool-sidebar,
.service-panel,
.photo-browser,
.publish-form,
.job-photo-copy {
  border: 1px solid rgba(24, 33, 28, 0.1);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brand-block {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(32px, 6vw, 64px);
  background: linear-gradient(155deg, #214c39, #18211c 62%, #384c3e);
  color: #fff;
}

.brand-block p:last-child {
  max-width: 540px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.signin-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  padding: clamp(28px, 4vw, 44px);
}

label {
  display: grid;
  gap: 8px;
  color: #37443c;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  padding: 12px 14px;
}

input {
  min-height: 46px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(47, 107, 79, 0.16);
}

.primary-action,
.secondary-action,
.tool-button {
  min-height: 46px;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-action {
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
}

.primary-action:hover:not(:disabled) {
  background: var(--brand-dark);
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-action:hover:not(:disabled) {
  border-color: var(--brand);
}

.compact {
  min-height: 40px;
}

.form-message {
  min-height: 24px;
  margin-bottom: 0;
  color: var(--brand-dark);
  font-size: 0.92rem;
  line-height: 1.45;
}

.publisher-view {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.tool-sidebar {
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
}

.tool-sidebar h1 {
  margin-bottom: 8px;
  font-size: 2.4rem;
}

.tool-sidebar p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tool-sidebar nav {
  display: grid;
  gap: 10px;
}

.tool-button {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.tool-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tool-sidebar .secondary-action {
  margin-top: auto;
}

.service-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
}

.service-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.service-panel strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.service-panel p,
.section-head p,
.photo-card small,
.publish-log {
  color: var(--muted);
}

.service-panel p,
.section-head p {
  margin-bottom: 0;
  line-height: 1.45;
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
  min-height: 0;
}

.photo-browser,
.publish-form,
.job-photo-copy {
  min-height: 0;
  padding: 20px;
}

.publish-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-head input {
  max-width: 260px;
}

.file-drop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px dashed var(--brand);
  border-radius: 8px;
  background: rgba(47, 107, 79, 0.06);
  margin-bottom: 16px;
  padding: 14px;
}

.file-drop span {
  color: var(--brand-dark);
  font-weight: 800;
}

.file-drop input {
  max-width: 320px;
  background: #fff;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 12px;
  max-height: calc(100vh - 214px);
  overflow: auto;
  padding-right: 4px;
}

.photo-card {
  display: grid;
  gap: 8px;
  min-height: 204px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  text-align: left;
}

.photo-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.16);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  object-fit: cover;
  background: var(--field);
}

.photo-card span {
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.photo-card small {
  font-size: 0.78rem;
  font-weight: 700;
}

fieldset {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.choice {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.choice input {
  width: 18px;
  min-height: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.publish-log {
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111813;
  color: #dce8df;
  padding: 14px;
  white-space: pre-wrap;
}

.job-photo-panel.active {
  display: grid;
  grid-template-columns: minmax(360px, 620px);
}

.job-photo-copy {
  width: 100%;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .publisher-view {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    grid-row: auto;
  }

  .tool-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-sidebar .secondary-action {
    margin-top: 0;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    padding: 14px;
  }

  .signin-view {
    min-height: calc(100vh - 28px);
    grid-template-columns: 1fr;
  }

  .brand-block {
    min-height: 280px;
  }

  .service-panel,
  .section-head {
    flex-direction: column;
  }

  .service-actions {
    justify-content: stretch;
    width: 100%;
  }

  .service-actions > * {
    justify-content: center;
  }

  .section-head input {
    max-width: none;
  }

  .file-drop {
    align-items: stretch;
    flex-direction: column;
  }

  .file-drop input {
    max-width: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
