:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f3ee;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

button {
  border: 0;
  background: #214e5c;
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f4f3ee 0%, #d9e7e5 56%, #f2d7c8 100%);
}

.login-box {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(23, 32, 42, 0.12);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(25, 44, 56, 0.18);
}

.login-box h1,
.topbar h1,
.section-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-box p,
.topbar p {
  color: #5d6875;
}

.login-box input {
  width: 100%;
  border: 1px solid #c6ccd3;
  border-radius: 6px;
  min-height: 44px;
  padding: 0 12px;
  margin: 12px 0;
}

.login-box button {
  width: 100%;
}

.login-box small,
.error-line {
  color: #a63a2a;
}

.app-view {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  border-bottom: 1px solid #d8d8d2;
  background: rgba(255, 255, 255, 0.76);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
}

.topbar p {
  margin: 6px 0 0;
}

.usage-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.usage-strip span {
  color: #59636f;
  white-space: nowrap;
}

.usage-strip strong {
  color: #17202a;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 24px;
  padding: 24px 32px 40px;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9d8d1;
  border-radius: 8px;
}

.admin-panel {
  grid-column: 1;
  padding: 16px;
  align-self: start;
}

.composer {
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 102px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #edf1f1;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.segmented button {
  background: transparent;
  color: #39434e;
}

.segmented button.active {
  background: #ffffff;
  color: #17202a;
  box-shadow: 0 1px 8px rgba(20, 36, 48, 0.12);
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  color: #49535f;
  margin-bottom: 14px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
}

.preset-row button,
.assist-row button {
  min-height: 32px;
  padding: 0 10px;
  background: #edf1f1;
  color: #214e5c;
  border: 1px solid #cbd8d8;
}

.assist-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 10px;
}

.assist-row button {
  min-height: 38px;
  background: #f7faf9;
}

.agent-note {
  min-height: 18px;
  margin: -2px 0 12px;
  color: #66717b;
  font-size: 13px;
  line-height: 1.4;
}

.agent-plan {
  border: 1px solid #b8cec9;
  background: #f3fbf8;
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 14px;
  display: grid;
  gap: 9px;
}

.agent-plan > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agent-plan span {
  color: #214e5c;
  font-size: 13px;
}

.agent-plan strong {
  color: #c34f38;
}

.agent-plan p {
  margin: 0;
  color: #39434e;
  line-height: 1.45;
  font-size: 13px;
}

.agent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.agent-actions button {
  min-height: 36px;
}

.agent-actions button:last-child {
  background: #e8eceb;
  color: #33404b;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd1d5;
  border-radius: 6px;
  background: #fff;
  color: #17202a;
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

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

.option-note {
  margin: -4px 0 14px;
  color: #66717b;
  font-size: 13px;
  line-height: 1.45;
}

#videoOptions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.estimate-box {
  border: 1px solid #d8c9b4;
  background: #fff8ed;
  border-radius: 8px;
  padding: 14px;
  margin: 4px 0 14px;
  display: grid;
  gap: 4px;
}

.estimate-box span,
.estimate-box small {
  color: #725844;
}

.estimate-box strong {
  font-size: 24px;
  letter-spacing: 0;
}

#generateButton {
  width: 100%;
  min-height: 48px;
  background: #c34f38;
}

.results {
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-note {
  margin: -8px 0 14px;
  color: #66717b;
  font-size: 13px;
}

.section-title button {
  background: #214e5c;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.result-card {
  background: #fff;
  border: 1px solid #d9d8d1;
  border-radius: 8px;
  overflow: hidden;
}

.media {
  aspect-ratio: 1 / 1;
  background: #e7e9e7;
  display: grid;
  place-items: center;
}

.media img,
.media video,
.media iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}

.placeholder,
.empty {
  color: #65707c;
  padding: 24px;
  text-align: center;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #b8beba;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.card-body {
  padding: 13px;
}

.card-head,
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-head span,
.meta,
.card-body p {
  color: #5d6875;
  font-size: 13px;
}

.card-body p {
  margin: 10px 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.meta span {
  overflow-wrap: anywhere;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.task-actions a,
.task-actions button {
  color: #214e5c;
  background: #eef4f3;
  border: 1px solid #d3dfdd;
  border-radius: 6px;
  padding: 6px 10px;
  text-decoration: none;
  font-size: 13px;
  min-height: 32px;
}

.task-actions button {
  cursor: pointer;
}

.task-actions button[data-action="delete"] {
  color: #a63a2a;
  background: #fff3ef;
  border-color: #ead2cb;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr minmax(72px, 90px);
  gap: 8px;
  border: 1px solid #e1e3df;
  border-radius: 8px;
  padding: 10px;
}

.user-row strong {
  grid-column: 1 / -1;
}

.user-row input {
  min-height: 36px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.storage-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid #e1e3df;
  padding-top: 14px;
}

.storage-box div {
  display: grid;
  gap: 4px;
}

.storage-box span {
  color: #66717b;
  font-size: 13px;
}

@media (max-width: 880px) {
  .topbar {
    position: static;
    align-items: flex-start;
    padding: 18px;
  }

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

  .admin-panel,
  .results {
    grid-column: auto;
    grid-row: auto;
  }

  .composer {
    position: static;
  }
}

@media (max-width: 560px) {
  .topbar,
  .usage-strip,
  .section-title {
    flex-direction: column;
    align-items: stretch;
  }

  .option-grid,
  #videoOptions {
    grid-template-columns: 1fr;
  }
}
