:root {
  --ink: #202124;
  --muted: #646b73;
  --line: #d8dde3;
  --panel: #ffffff;
  --soft: #f3f7f6;
  --accent: #0f766e;
  --accent-dark: #134e4a;
  --warm: #f59e0b;
  --focus: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #eef6f4 0%, #f7f4ed 100%);
}

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

.app-shell {
  min-height: 100vh;
  padding: 20px;
}

.workbench {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
}

h2 {
  font-size: 24px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.routine-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 16px;
}

.tab {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.prompt-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.prompt-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.password-field {
  display: none;
}

.password-field.visible {
  display: grid;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.result-panel {
  min-height: 620px;
  overflow: hidden;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  background: var(--soft);
}

.status-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.routine-output {
  padding: 20px 22px 28px;
  line-height: 1.58;
  white-space: normal;
}

.routine-output h1,
.routine-output h2,
.routine-output h3 {
  margin: 18px 0 8px;
  line-height: 1.2;
}

.routine-output h1:first-child,
.routine-output h2:first-child,
.routine-output h3:first-child {
  margin-top: 0;
}

.routine-output ul,
.routine-output ol {
  padding-left: 22px;
}

.routine-output li {
  margin: 5px 0;
}

.routine-output p {
  margin: 0 0 12px;
}

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

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

  .result-panel {
    min-height: 420px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .routine-tabs,
  .prompt-panel,
  .status-badge {
    display: none;
  }

  .app-shell {
    padding: 0;
  }

  .editor-grid {
    display: block;
  }

  .result-panel {
    border: 0;
  }
}
