:root {
  --ink: #14213d;
  --ink-soft: #3a4a63;
  --accent: #fca311;
  --accent-dark: #e07a00;
  --surface: #ffffff;
  --surface-alt: rgba(255, 255, 255, 0.78);
  --line: rgba(20, 33, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffffff 0%, #f8efe1 40%, #ece9ff 100%);
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.brand-title {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--ink-soft);
		display: none;
}

.mobile-menu-toggle {
  display: none;
}

.progress {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-wrap: wrap;
}

.progress a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.35rem 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
		margin-right: 2px;
}

.progress-disabled {
  color: var(--ink-soft);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.5;
}

.progress :is(a, .progress-disabled) {
  position: relative;
}

.progress :is(a, .progress-disabled):not(:first-child)::before {
  content: "";
  display: none;
  position: absolute;
  left: -0.35rem;
  width: 0.35rem;
  height: 2px;
  background: #bcbcbc;
  top: 50%;
  transform: translateY(-50%);
}

.step-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #2e7d32;
  flex: 0 0 18px;
}

.step-icon.completed {
  border-color: rgba(46, 125, 50, 0.35);
  background: rgba(46, 125, 50, 0.12);
}

.progress a.active {
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(252, 163, 17, 0.15);
}

.progress a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(20, 33, 61, 0.05);
}

.generate {
  background: var(--accent);
  color: #1b1b1b;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(252, 163, 17, 0.25);
}

.generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(252, 163, 17, 0.35);
}

.is-hidden {
  display: none;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.logout-button {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
}

.logout-button.icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logout-button.icon-only svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 2rem;
  background: var(--surface-alt);
  border-radius: 24px;
  padding: 2rem 2.5rem;
  box-shadow: 0 24px 50px rgba(20, 33, 61, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.footer {
  margin: 0 auto 2rem;
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-center {
  justify-self: center;
}

.footer-right {
  justify-self: end;
}

.admin-button {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  color: var(--ink);
  background: #fff;
}

.dashboard-hero-logo {
  float: right;
  margin-left: 30px;
  margin-bottom: 20px;
}

.public-links {
  display: inline-flex;
  gap: 1rem;
  margin-left: auto;
}

.public-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  background: #fff;
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.public-links a.primary-link {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: 0 10px 20px rgba(20, 33, 61, 0.2);
}

.public-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(20, 33, 61, 0.16);
}

h1 {
  margin-top: 0;
  font-size: 2.2rem;
}

.field {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.field-compact select {
  width: max-content;
  min-width: 10rem;
}

.activity-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem 1.5rem 0.7rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.85);
}

.activity-section h2 {
  margin-top: 0;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.activity-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drag-handle,
.delete-activity,
.delete-budget {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
}

.drag-handle {
  cursor: grab;
}

.activity-section.dragging {
  opacity: 0.6;
}

.activity-section.drag-over {
  border-color: #f6c453;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.25);
}

.budget-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.budget-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.budget-icon {
  font-size: 1.4rem;
}

.budget-total {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.budget-table-header,
.budget-row {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.6fr 0.6fr 1.6fr auto;
  gap: 1rem;
  align-items: start;
}

.budget-table-header {
  font-size: 0.84rem;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  background: #f7f1e6;
}

.info-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 0.35rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 33, 61, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem;
  max-width: 1100px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 24px 50px rgba(20, 33, 61, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

	  .modal-header h1, .modal-header h2 {
		margin-top: 0;
	  }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
}

.secondary {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.category-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
}

.category-card h3 {
  margin-top: 0;
  font-size: 1rem;
}

.budget-row {
  padding: 1rem 0.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.budget-row.drag-over {
  background: rgba(246, 196, 83, 0.2);
}

.chat-shell {
  display: flex;
		position: relative;
  flex-direction: column;
  gap: 1rem;
  height: 64vh;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

.chat-status {
  display: none;
  font-size: 0.85rem;
  color: var(--ink-soft);
  grid-template-columns: 1fr;
  gap: 0rem;
  text-align: right;
		font-style: italic;
}

.chat-status-title {
  font-weight: 700;
  color: var(--ink);
}

.chat-status-line {
  min-height: 1.1rem;
}

.chat-input textarea:disabled {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.chat-message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  position: relative;
  padding-right: 2.35rem;
}

.chat-message-body {
  min-width: 0;
}

.chat-export-button {
  position: absolute;
  right: 0.45rem;
  bottom: 0.35rem;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #fff4bf;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  line-height: 1;
}

.chat-export-button:hover {
  background: #ffeaa0;
  color: var(--ink);
}

.chat-export-button.is-exporting,
.export-all-button.is-exporting {
  opacity: 0.9;
  cursor: progress;
}

.chat-export-button svg {
  width: 1.85rem;
  height: 1.85rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-export-button.is-exporting svg,
.export-all-button.is-exporting svg {
  animation: export-spin 0.9s linear infinite;
}

@keyframes export-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.export-all-button {
  border-color: var(--ink);
  color: var(--ink);
  background: #fff4bf;
  padding: 0.7rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
		position: absolute;
		right: 25px;
		top: 56px;
}

.export-all-button svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.export-all-button span {
  font-weight: 600;
  line-height: 1;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  white-space: normal;
}

.chat-message.assistant h1,
.chat-message.assistant h2,
.chat-message.assistant h3,
.chat-message.assistant h4,
.chat-message.assistant h5 {
  margin: 0.35rem 0 0.5rem;
  line-height: 1.25;
}

.chat-message.assistant h1 {
  font-size: 1.2rem;
}

.chat-message.assistant h2 {
  font-size: 1.08rem;
}

.chat-message.assistant h3 {
  font-size: 1rem;
}

.chat-message.assistant h4 {
  font-size: 0.94rem;
}

.chat-message.assistant h5 {
  font-size: 0.88rem;
}

.chat-message.assistant p {
  margin: 0.35rem 0;
}

.chat-message.assistant em {
  font-style: italic;
}

.chat-message.assistant ul {
  margin: 0.35rem 0;
  padding-left: 1.4rem;
  margin-left: 0.15rem;
}

.chat-message.assistant ol {
  margin: 0.35rem 0;
  padding-left: 1.4rem;
  margin-left: 0.15rem;
}

.chat-message.assistant li > ul,
.chat-message.assistant li > ol {
  margin-top: 0.25rem;
  margin-left: 0.55rem;
}

.chat-message.assistant .task-list {
  list-style: none;
  padding-left: 0;
}

.chat-message.assistant .task-item {
  margin: 0.25rem 0;
}

.chat-message.assistant .task-item input[type="checkbox"] {
  margin-right: 0.45rem;
  vertical-align: middle;
}

.chat-message.assistant table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.chat-message.assistant th,
.chat-message.assistant td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.chat-message.assistant th {
  background: rgba(0, 0, 0, 0.03);
}

.chat-message.assistant hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.7rem 0;
}

.chat-message.assistant pre {
  margin: 0.5rem 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f7f7;
  overflow-x: auto;
}

.chat-message.assistant pre code {
  background: transparent;
  padding: 0;
  font-size: 0.92em;
}

.chat-message.assistant code {
  background: #f2f2f2;
  border-radius: 6px;
  padding: 0.1rem 0.3rem;
}

.chat-message.typing {
  opacity: 1;
  font-style: normal;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  background: #fdf0c9;
  border-color: #f6c453;
  color: #8a5a00;
  padding-right: 1rem;
}

.chat-input {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.chat-input textarea {
  flex: 1;
  min-height: 3.5rem;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
		margin-left: 20px;
		margin-right: 20px;
}

.workflow-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.preload-status {
  font-size: 0.95rem;
  color: var(--ink-soft);
  min-height: 1.4rem;
}

#workflow-log {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  cursor: pointer;
}

#workflow-log.workflow-readonly {
  cursor: default;
}

#workflow-log:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#send-chat,
#export-conversation,
#workflow-log {
  height: 44px;
  box-sizing: border-box;
  z-index: 1000;
}

.workflow-icon {
  width: 18px;
  height: 18px;
  margin-left: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #9e9e9e;
  box-shadow: 0 0 0 10px rgba(158, 158, 158, 0.15);
}

.workflow-icon.running {
  background: #f6c453;
  box-shadow: 0 0 0 14px rgba(246, 196, 83, 0.25);
  animation: pulse 1.2s infinite ease-in-out;
}

.workflow-icon.finished {
  background: #2e7d32;
  box-shadow: none;
}

.dept-table-header,
.dept-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 30px;
  gap: 0.75rem;
  align-items: center;
}

.dept-table-header {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
}

.dept-row input {
  width: 100%;
}

.delete-dept {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

#add-current-dept,
#add-future-dept {
  margin-top: 0.75rem;
  background: transparent;
  border: 1px dashed var(--ink-soft);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.impact-header,
.impact-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr auto;
  gap: 1rem;
  align-items: start;
}

.impact-header {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  background: #f7f1e6;
}

.impact-header-cell {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.mission-form .field > label:not(.checkbox):not(.skip-toggle) {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  background: #f7f1e6;
  margin-bottom: 0.35rem;
}

.activities-form .field > label:not(.checkbox):not(.skip-toggle) {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  background: #f7f1e6;
  margin-bottom: 0.35rem;
}

.dept-table-header span:not(:last-child) {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  background: #f7f1e6;
}

label[for="current-structure"],
label[for="future-structure"] {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 8px;
  background: #f7f1e6;
  margin-bottom: 0.35rem;
}

.impact-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.impact-pair {
  display: grid;
  gap: 0.5rem;
}

.impact-pair label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: grid;
  gap: 0.25rem;
}

.impact-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: grid;
  gap: 0.25rem;
}

.delete-impact {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

#add-impact {
  background: transparent;
  border: 1px dashed var(--ink-soft);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink-soft);
}

@keyframes pulse {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(0.85);
  }
}


.budget-row .field {
  margin-bottom: 0;
}

.budget-actions {
  display: flex;
  gap: 0.5rem;
}

label {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.amount-field {
  max-width: 150px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
}

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

.budget-row textarea {
  min-height: 3.2rem;
}

.budget-item-mobile-title {
  display: none;
}

.budget-item-mobile-subtitle {
  display: none;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.2);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.skip-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f1f1 100%);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 0 rgba(20, 33, 61, 0.22);
  transform: translateY(-1px);
}

.skip-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.skip-toggle.active {
  background: linear-gradient(180deg, rgba(252, 163, 17, 0.28) 0%, rgba(252, 163, 17, 0.16) 100%);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(20, 33, 61, 0.14);
  transform: translateY(0);
}

input[type="text"].optional-skipped,
textarea.optional-skipped,
select.optional-skipped,
input[type="text"]:disabled,
textarea:disabled,
select:disabled {
  background: #ececec;
  color: #777;
  border-color: #d3d3d3;
  cursor: not-allowed;
}

.errors {
  color: #9b1d1d;
  background: rgba(255, 255, 255, 0.9);
  border-left: 4px solid #d95050;
  padding: 1rem 1.25rem;
  border-radius: 12px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.actions.section-actions {
  justify-content: flex-start;
}

.primary {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font-size: 1rem;
  cursor: pointer;
}

#add-activity {
  background: transparent;
  border: 1px dashed var(--ink-soft);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink-soft);
}

#activity-count-info {
  margin-top: 1rem;
  color: var(--ink-soft);
}

#add-activity:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#add-budget {
  background: transparent;
  border: 1px dashed var(--ink-soft);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink-soft);
}

#add-budget:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#budget-count-info {
  margin-top: 1rem;
  color: var(--ink-soft);
}

@media (max-width: 815px) {
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.8rem;
  }

  .steps-header-inner {
    display: grid;
    padding: 0.75rem 0.8rem;
  }

  .mobile-menu-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .header-inner .brand-logo {
    grid-column: 1;
    grid-row: 1;
    margin-left: 0;
    min-width: 0;
  }

  .header-inner .progress,
  .header-inner .header-actions,
  .header-inner .public-links {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
  }

  .header-inner.mobile-menu-open .progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0;
    white-space: normal;
    padding-top: 0.35rem;
  }

  .header-inner.mobile-menu-open .header-actions,
  .header-inner.mobile-menu-open .public-links {
    display: flex;
    margin-left: 0;
    margin-right: 0;
    padding-top: 0.35rem;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .steps-header-inner .progress a,
  .steps-header-inner .progress .progress-disabled {
    display: inline-flex;
    width: auto;
    margin: 0;
    flex: 0 1 auto;
  }

  .steps-header-inner .progress [data-step="mission"],
  .steps-header-inner .progress [data-step="activities"] {
    margin-top: 0;
    margin-bottom: 0;
  }

  .progress :is(a, .progress-disabled):not(:first-child)::before {
    content: none;
  }

  .public-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 0.75rem 0.8rem;
  }

  .brand-logo {
    margin-left: 0;
  }

  .public-header-inner .brand-logo {
    margin-left: 0;
  }

  .public-header-inner .public-links {
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  .public-header-inner .public-links a {
    padding: 0.42rem 0.72rem;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .public-header-inner .public-links a.primary-link {
    margin-left: 0;
  }

  h1 {
    font-size: 1.1rem;
  }

  #erase-all-button {
    font-size: 0.8em;
		  padding: 0.7rem 0.4rem;
  }

  .dashboard-hero-logo {
    float: none;
    display: block;
    margin: 0 auto 16px auto;
  }

  .content .primary,
  .content .secondary {
    font-size: 0.85rem;
  }

  #workflow-log {
    width: 5rem;
    padding: 0.3rem 0.4rem;
  }

  .preload-status {
    display: none;
  }

  .content {
    margin: 0;
    padding: 0.75rem 1rem;
	border: 0;
	border-radius: 0;
  }

  .modal {
    padding: 0;
  }

  .modal-content {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
  }

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

  .field-compact select {
    width: 100%;
    min-width: 0;
  }

  .budget-table-header {
    display: none;
  }

  .budget-row {
    grid-template-columns: 1fr;
    padding: 1.5rem 0;
  }

  .budget-item-mobile-title {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(20, 33, 61, 0.14);
    border-radius: 8px;
    background: #f7f1e6;
  }

  .budget-item-mobile-subtitle {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .budget-row .field.inline-skip-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.45rem;
    row-gap: 0.2rem;
  }

  .budget-row .field.inline-skip-control > input[type="text"],
  .budget-row .field.inline-skip-control > select {
    grid-column: 1;
  }

  .budget-row .field.inline-skip-control > .skip-toggle {
    grid-column: 2;
    margin: 0;
    align-self: center;
    white-space: nowrap;
  }

  .budget-row select[name$="_currency"],
  .budget-row select[name$="_category"],
  .budget-row .amount-field {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .impact-header {
    display: none;
  }

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

  .budget-actions {
    padding-top: 0;
  }

  .chat-input {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px rgba(20, 33, 61, 0.1);
  }

  .chat-input textarea {
    min-width: 0;
    width: auto;
  }

  .chat-actions {
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-left: 0;
    margin-right: 0;
  }

  #deliverable-select {
    width: 44%;
    min-width: 0;
    font-size: 0.82rem;
  }

 .phone {
	 display: none;
 }

 .chat-shell .chat-messages {
	 padding: 0 0 0rem;
	 border: 0;
	 font-size: 85%;
  }

  .chat-shell {
    padding-bottom: 1.5rem;
  }

  .chat-message {
	  padding: 5px;
	  margin-left: 0;
  }

  .workflow-controls {
	  position: relative;
	  top: -6px;
  }

  #export-conversation {
	top: 1px;
	right: 1px;
  }
  
  .footer {
	  background: var(--surface-alt);
	  margin: 0;
  }

  .page-chat .footer {
	  margin-bottom: 5.3rem !important;
  }
  
  .chat-shell {
	  height: 77svh;
  }
  
  .page {
	  background: rgba(255, 255, 255, 1.0);
  }
  
  #chat-input {
	  font-size: 90%;
  }
}

@media (max-height: 399px) and (min-aspect-ratio: 1/1) {
  .header {
    position: static;
  }

		.chat-messages {
		  min-height: 120vh;
		}

		.chat-shell {
		  min-height: 178vh;
		}
}
