:root {
  color: #162033;
  background: #eef4fb;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(16, 87, 154, 0.16), transparent 34%),
    linear-gradient(225deg, rgba(40, 133, 120, 0.14), transparent 36%),
    linear-gradient(180deg, #f7fbff 0%, #eaf2fb 52%, #f6f8fb 100%);
}

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

button {
  min-height: 42px;
  border: 1px solid #c7d7e8;
  border-radius: 8px;
  background: #ffffff;
  color: #1a2a44;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(20, 44, 75, 0.04);
}

button:hover {
  border-color: #84a9d4;
  background: #f6faff;
}

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

.primary {
  background: #0f63b6;
  border-color: #0f63b6;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 99, 182, 0.2);
}

.primary:hover {
  background: #0b559f;
  border-color: #0b559f;
}

.wide {
  width: 100%;
}

.record {
  background: #16807a;
  border-color: #16807a;
  color: #ffffff;
}

.record:hover {
  background: #126f6a;
  border-color: #126f6a;
}

.danger {
  background: #b83d4a;
  border-color: #b83d4a;
  color: #ffffff;
}

.danger.subtle {
  background: #fff8f8;
  color: #9a2633;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.mode-badge {
  border: 1px solid #b8d7ef;
  border-radius: 999px;
  background: #eaf6ff;
  color: #0f63b6;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(163, 190, 220, 0.62);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(19, 45, 76, 0.18);
  backdrop-filter: blur(10px);
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f63b6, #16807a);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 30px rgba(15, 99, 182, 0.24);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
}

.login-panel h1,
.topbar h1 {
  margin: 16px 0 8px;
  letter-spacing: 0;
}

.login-panel p {
  color: #50627a;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 8px;
  color: #263750;
  font-weight: 750;
  margin: 16px 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7d7e8;
  border-radius: 8px;
  background: #fbfdff;
  color: #162033;
  padding: 12px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(20, 44, 75, 0.03);
}

textarea {
  scrollbar-color: #9db8d8 #edf4fb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0f63b6;
  box-shadow: 0 0 0 3px rgba(15, 99, 182, 0.14);
}

small,
.muted {
  color: #6a7b91;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 310px 1fr;
}

.sidebar {
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid rgba(170, 194, 220, 0.72);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 12px 0 35px rgba(35, 66, 101, 0.08);
  backdrop-filter: blur(10px);
}

.sidebar-head,
.brand-row,
.panel-title-row,
.button-row,
.actions-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-head,
.panel-title-row {
  justify-content: space-between;
}

.brand-row span {
  display: block;
  color: #63738a;
  font-size: 13px;
  margin-top: 2px;
}

.history,
.template-folder {
  min-height: 0;
}

.history {
  overflow: auto;
}

.history h2,
.setup-folder h2,
.tool-folder h2,
.template-folder h2,
.panel h2 {
  font-size: 15px;
  margin: 0 0 12px;
  color: #13243d;
}

.helper-text {
  color: #63738a;
  font-size: 13px;
  line-height: 1.4;
  margin: -2px 0 12px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.compact-talk,
.compact-format {
  min-height: 34px;
  padding: 0 12px;
}

.history-item,
.setup-item,
.tool-item,
.template-item {
  width: 100%;
  height: auto;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 10px;
  padding: 12px;
  border-color: #d4e1ee;
  background: #ffffff;
}

.setup-item,
.tool-item {
  position: relative;
}

.setup-item::before,
.tool-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16807a;
  position: absolute;
  top: 13px;
  right: 13px;
}

.setup-item:hover,
.tool-item:hover,
.template-item:hover,
.history-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30, 62, 99, 0.1);
}

.template-item.active {
  border-color: #0f63b6;
  background: #eaf4ff;
  box-shadow: inset 4px 0 0 #0f63b6;
}

.tool-item.active {
  border-color: #16807a;
  background: #e9f8f6;
  box-shadow: inset 4px 0 0 #16807a;
}

.history-item span,
.setup-item span,
.tool-item span,
.template-item span {
  font-size: 12px;
  color: #66778d;
}

.hidden-file {
  display: none;
}

.setup-note {
  margin: 0;
  font-size: 13px;
}

.document-list {
  display: grid;
  gap: 8px;
}

.document-chip {
  border: 1px solid #d4e1ee;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.document-chip strong,
.document-chip span {
  display: block;
}

.document-chip strong {
  color: #1a2a44;
  font-size: 13px;
}

.document-chip span {
  color: #66778d;
  font-size: 12px;
  margin-top: 2px;
}

.history-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.mini-danger {
  min-height: auto;
  align-self: stretch;
  color: #9a2633;
}

.workspace {
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 4px 0 2px;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 42px);
  max-width: 820px;
  color: #10233d;
}

.eyebrow {
  color: #0f63b6;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 900;
}

.status-pill {
  border: 1px solid #c7d7e8;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #52657d;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(21, 54, 91, 0.08);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-card {
  min-height: 118px;
  border: 1px solid rgba(190, 209, 229, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.96)),
    #ffffff;
  padding: 16px;
  box-shadow: 0 14px 35px rgba(30, 62, 99, 0.09);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(30, 62, 99, 0.13);
}

.dashboard-card span {
  display: block;
  color: #64768c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-card strong {
  display: block;
  color: #10233d;
  font-size: 28px;
  margin: 8px 0 4px;
  letter-spacing: 0;
}

.dashboard-card small {
  display: block;
  line-height: 1.35;
}

.dashboard-card.accent {
  background: linear-gradient(135deg, #0f63b6, #16807a);
  border-color: transparent;
  color: #ffffff;
}

.dashboard-card.accent span,
.dashboard-card.accent strong,
.dashboard-card.accent small {
  color: #ffffff;
}

.dashboard-card.accent strong {
  font-size: 22px;
}

.note-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(390px, 1.2fr);
  gap: 16px;
}

.aim-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 16px;
}

.profile-panel {
  min-height: 180px;
}

.empty-profile {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-badge {
  border: 1px solid #b8d7ef;
  border-radius: 999px;
  background: #eaf6ff;
  color: #0f63b6;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
}

.profile-name {
  display: block;
  color: #10233d;
  font-size: 24px;
  margin: 4px 0 14px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.profile-grid div {
  border: 1px solid #d7e3ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.profile-grid span,
.profile-grid strong {
  display: block;
}

.profile-grid span {
  color: #66778d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-grid strong {
  color: #1a2a44;
  font-size: 13px;
  margin-top: 4px;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 16px;
}

.checklist-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid #d7e3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.check-row input {
  width: auto;
  margin-top: 3px;
}

.check-row span {
  line-height: 1.35;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(190, 209, 229, 0.86);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(30, 62, 99, 0.1);
}

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

.form-grid label {
  margin: 0 0 12px;
}

.recorder-panel,
.output-panel {
  min-height: 360px;
}

.recorder-panel textarea,
.output-panel textarea,
.contacts-panel textarea {
  min-height: 285px;
  resize: vertical;
  line-height: 1.5;
}

.contacts-panel textarea {
  min-height: 118px;
}

.output-panel {
  grid-column: 1 / -1;
}

.aim-services {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.aim-service-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, minmax(90px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7e3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.aim-service-row label {
  margin: 0;
}

.aim-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #bfd5ec;
  border-radius: 8px;
  background: #edf7ff;
}

.aim-total span {
  color: #52657d;
  font-weight: 800;
}

.aim-total strong {
  color: #0f63b6;
  font-size: 22px;
}

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

.custom-template-card {
  border: 1px solid #d7e3ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.custom-template-card strong,
.custom-template-card span,
.custom-template-card small {
  display: block;
}

.custom-template-card strong {
  color: #10233d;
}

.custom-template-card span {
  color: #0f63b6;
  font-size: 13px;
  font-weight: 800;
  margin-top: 3px;
}

.custom-template-card small {
  margin-top: 4px;
}

.final-note {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  background: #f9fcff;
}

.actions-panel {
  grid-column: 1 / -1;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.question-card {
  border: 1px solid #bfd5ec;
  border-radius: 8px;
  background: #edf7ff;
  padding: 12px;
  margin-bottom: 12px;
}

.question-card span {
  display: block;
  color: #0f63b6;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.question-card strong {
  display: block;
  line-height: 1.4;
}

.question-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #d7e3ef;
    box-shadow: 0 12px 35px rgba(35, 66, 101, 0.08);
  }

  .note-grid,
  .aim-grid,
  .builder-grid,
  .form-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

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

  .topbar {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .panel-title-row,
  .button-row,
  .label-row {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-actions,
  .button-row,
  .panel-title-row button,
  .label-row button {
    width: 100%;
  }
}
