:root {
  --bs-body-bg: #fbf2e4;
  --bs-body-color: #18252d;
  --bs-primary: #8f3f22;
  --bs-primary-rgb: 143, 63, 34;
  --bs-secondary: #fffaf2;
  --bs-secondary-rgb: 255, 250, 242;
  --bs-border-color: rgba(24, 37, 45, 0.12);
  --bs-link-color: #8f3f22;
  --bs-link-hover-color: #c56035;
  --bs-border-radius: 1.1rem;
  --bs-border-radius-lg: 1.5rem;
  --bs-border-radius-xl: 1.75rem;
  --bs-box-shadow: 0 30px 60px rgba(84, 52, 28, 0.12);
  --shell-bg: #fbf2e4;
  --shell-bg-strong: #f0e4d2;
  --shell-card: #fffaf2;
  --shell-card-strong: #f7ebde;
  --shell-ink: #18252d;
  --shell-muted: #5f6770;
  --shell-line: rgba(24, 37, 45, 0.12);
  --shell-accent: #c56035;
  --shell-accent-strong: #8f3f22;
  --shell-warm: #f0a45d;
  --shell-shadow: 0 30px 60px rgba(84, 52, 28, 0.12);
  --shell-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --shell-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--shell-ink);
  background:
    radial-gradient(circle at top left, rgba(255, 252, 246, 0.96), transparent 34%),
    radial-gradient(circle at 82% 14%, rgba(240, 164, 93, 0.16), transparent 26%),
    linear-gradient(180deg, var(--shell-bg) 0%, #f9f0e3 52%, #f5e8d8 100%);
  font-family: var(--shell-sans);
  line-height: 1.6;
}

.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 999px;
}

.btn-primary {
  --bs-btn-bg: var(--shell-accent-strong);
  --bs-btn-border-color: var(--shell-accent-strong);
  --bs-btn-hover-bg: var(--shell-accent);
  --bs-btn-hover-border-color: var(--shell-accent);
  --bs-btn-active-bg: var(--shell-accent);
  --bs-btn-active-border-color: var(--shell-accent);
  --bs-btn-color: #fffaf0;
  --bs-btn-hover-color: #fffaf0;
  box-shadow: 0 14px 28px rgba(143, 63, 34, 0.18);
}

.btn-outline-secondary {
  --bs-btn-color: var(--shell-ink);
  --bs-btn-border-color: rgba(24, 37, 45, 0.16);
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.9);
  --bs-btn-hover-border-color: rgba(24, 37, 45, 0.24);
  --bs-btn-hover-color: var(--shell-ink);
  --bs-btn-active-bg: rgba(255, 250, 240, 0.98);
  --bs-btn-active-color: var(--shell-ink);
  --bs-btn-active-border-color: rgba(197, 96, 53, 0.28);
}

.form-control,
.form-select {
  border-radius: 1rem;
  border-color: rgba(24, 37, 45, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--shell-ink);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(197, 96, 53, 0.38);
  box-shadow: 0 0 0 0.25rem rgba(197, 96, 53, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  color: var(--shell-accent-strong);
}

a:hover {
  color: var(--shell-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(63, 110, 80, 0.35);
  outline-offset: 3px;
}

.app-body,
.shell-body {
  position: relative;
}

.app-backdrop,
.shell-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 30%),
    radial-gradient(circle at 20% 90%, rgba(197, 96, 53, 0.08), transparent 20%);
}

.hero-card,
.shell-panel {
  position: relative;
  overflow: hidden;
  padding: 1.75rem;
  border: 1px solid var(--shell-line);
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: var(--shell-shadow);
}

.app-shell-card,
.app-section-card,
.app-header-card,
.app-footer-card {
  backdrop-filter: blur(14px);
}

.shell-panel-compact {
  max-width: 720px;
}

.hero-card::after,
.shell-panel::after {
  content: "";
  position: absolute;
  inset: auto -2rem -2rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(191, 127, 61, 0.14), transparent 68%);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  align-items: end;
}

.hero-copy h1,
.shell-panel h1,
.shell-panel h2 {
  margin: 0;
  font-family: var(--shell-serif);
  font-weight: 700;
  line-height: 1.1;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
}

.shell-panel h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.shell-panel h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--shell-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: #33443a;
  font-size: 1.05rem;
}

.hero-actions,
.action-row,
.shell-form,
.shell-actions {
  display: flex;
  gap: 0.85rem;
}

.hero-actions,
.action-row,
.shell-actions {
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions {
  justify-content: flex-start;
  align-content: start;
}

.shell-form {
  flex-direction: column;
  align-items: stretch;
  margin-top: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field span:first-child {
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--shell-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--shell-ink);
  font: inherit;
}

.field .form-control,
.field .form-select {
  min-height: 3rem;
  padding: 0.8rem 0.95rem;
}

.field small {
  color: var(--shell-muted);
}

.field span.field-validation-error,
.validation-summary-errors {
  color: #8f3f2c;
}

.shell-button,
.shell-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
}

.shell-button {
  background: var(--shell-accent-strong);
  color: #fffaf0;
  box-shadow: 0 14px 28px rgba(40, 73, 54, 0.22);
}

.shell-button:hover {
  color: #fffaf0;
  background: var(--shell-accent);
}

.shell-link {
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.62);
}

.shell-button.btn,
.shell-link.btn {
  min-height: 3rem;
  padding: 0.8rem 1.2rem;
}

.shell-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.auth-grid {
  align-items: start;
}

.write-grid {
  align-items: start;
}

.write-hero {
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
}

.write-status-card {
  flex-direction: column;
  align-items: stretch;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--shell-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.app-stat-grid {
  display: grid;
  gap: 0.85rem;
}

.app-stat-card {
  width: 100%;
  justify-content: flex-start;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.choice-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.choice-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--shell-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.choice-pill input:checked + span {
  border-color: rgba(40, 73, 54, 0.35);
  background: rgba(233, 242, 237, 0.95);
  box-shadow: 0 12px 24px rgba(40, 73, 54, 0.09);
}

.write-block {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.preview-card {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--shell-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.preview-card-with-media {
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: start;
}

.preview-card-media {
  width: 200px;
}

.preview-card-with-media .preview-media-shell {
  height: 200px;
  margin-bottom: 0;
}

.preview-card-copy {
  display: grid;
  gap: 0.9rem;
}

.media-upload-card {
  padding: 1rem 1.1rem;
  border: 1px dashed rgba(143, 63, 34, 0.22);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
}

.preview-media-shell,
.public-image-shell {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(24, 37, 45, 0.08);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(240, 228, 210, 0.86));
}

.preview-media-shell.is-hidden {
  display: none;
}

.preview-image,
.public-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 20rem;
  object-fit: cover;
}

.preview-meta {
  margin: 0;
  color: #737a84;
  font-size: 0.875rem;
}

.preview-body {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.7;
}

.milestone-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.milestone-entry {
  display: grid;
  gap: 0.2rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(197, 96, 53, 0.22);
}

.milestone-label {
  font-weight: 600;
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1rem;
}

.action-stack > * {
  flex: 0 1 auto;
}

.mine-grid {
  align-items: start;
}

.cabinet-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.cabinet-card {
  padding: 1rem;
  border: 1px solid var(--shell-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
}

.cabinet-header {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.cabinet-header h3 {
  margin: 0;
  font-family: var(--shell-serif);
  font-size: 1.2rem;
}

.cabinet-media-shell {
  width: 200px;
  height: 200px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(24, 37, 45, 0.08);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(240, 228, 210, 0.86));
}

.cabinet-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.status-chip-soft {
  min-height: 2.2rem;
  background: rgba(255, 255, 255, 0.72);
}

.inline-form {
  margin: 0;
}

.action-stack .inline-form {
  display: flex;
}

.inline-form button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.quiet-slot {
  justify-self: end;
}

.public-shell {
  max-width: 920px;
}

.public-body {
  font-size: 1.08rem;
}

.choice-card {
  position: relative;
  display: grid;
}

.choice-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice-card span {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--shell-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.choice-card strong {
  font-family: var(--shell-serif);
  font-size: 1.08rem;
}

.choice-card small {
  color: var(--shell-muted);
}

.choice-card input:checked + span {
  border-color: rgba(40, 73, 54, 0.35);
  background: rgba(233, 242, 237, 0.95);
  box-shadow: 0 12px 24px rgba(40, 73, 54, 0.09);
}

.device-draft-note {
  margin-top: 1rem;
}

.shell-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}

.shell-list li + li {
  margin-top: 0.45rem;
}

.support-hint {
  margin: 1rem 0 0;
  color: #737a84;
  font-size: 0.875rem;
}

.content-preview {
  margin: 0.55rem 0 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.content-preview-muted {
  color: #41474f;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(251, 242, 228, 0.74);
  border-bottom: 1px solid rgba(24, 37, 45, 0.08);
}

.app-header .container-xl {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.app-header-card,
.app-footer-card {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(24, 37, 45, 0.08);
  border-radius: 24px;
  background: rgba(255, 248, 239, 0.78);
  box-shadow: 0 18px 40px rgba(84, 52, 28, 0.09);
}

.app-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.app-mark-copy {
  display: inline-grid;
  gap: 0.1rem;
}

.app-mark-image {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(143, 63, 34, 0.16);
}

.app-mark-kicker {
  color: var(--shell-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-mark-name {
  color: #2a3138;
  font-family: var(--shell-serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.app-nav,
.header-tools,
.account-form,
.app-footer-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.app-nav {
  justify-content: flex-start;
}

.app-nav-link,
.account-link,
.locale-button,
.locale-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--shell-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--shell-ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.app-nav-link.is-active,
.account-link.is-active,
.locale-button.is-active {
  background: rgba(255, 244, 232, 0.98);
  border-color: rgba(197, 96, 53, 0.28);
  box-shadow: 0 14px 28px rgba(143, 63, 34, 0.1);
}

.locale-switcher {
  gap: 0.5rem;
}

.locale-switcher-select {
  display: flex;
  align-items: center;
}

.locale-select {
  min-width: 9rem;
  padding-right: 2.25rem;
}

.quiet-back-button {
  width: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
}

.quiet-back-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.app-header-quiet .app-header-card {
  padding: 0.8rem 1rem;
}

.app-header-quiet .app-mark-image {
  width: 2.25rem;
  height: 2.25rem;
}

.app-header-quiet .app-mark-kicker {
  font-size: 0.72rem;
}

.app-header-quiet .app-mark-name {
  font-size: 1.1rem;
  color: #646c75;
}

.app-frame {
  padding: 1.25rem 0 2.5rem;
}

.app-main {
  display: grid;
  gap: 1.25rem;
}

.app-hero {
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
}

.app-grid {
  align-items: start;
}

.role-panel {
  min-height: 100%;
}

.flash-banner {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--shell-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 28px rgba(24, 37, 45, 0.06);
}

.flash-banner-info {
  border-color: rgba(197, 96, 53, 0.24);
}

.flash-banner-error {
  border-color: rgba(143, 63, 34, 0.28);
}

.app-footer {
  margin-top: 1rem;
  color: var(--shell-muted);
}

.app-footer-card {
  display: grid;
  gap: 1rem;
}

.app-footer-build {
  margin: 0;
  color: var(--shell-ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.app-footer-links {
  flex-wrap: wrap;
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 0.4rem;
  background: rgba(38, 51, 44, 0.08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (max-width: 860px) {
  .hero-card,
  .shell-grid,
  .preview-card-with-media,
  .cabinet-header {
    grid-template-columns: 1fr;
  }

  .preview-card-media,
  .cabinet-media-shell {
    width: 100%;
  }

  .preview-card-with-media .preview-media-shell,
  .cabinet-media-shell {
    height: 12rem;
  }

  .app-nav,
  .header-tools {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .app-header-quiet .header-tools {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 560px) {
  html {
    font-size: 15px;
  }

  .hero-card,
  .shell-panel {
    padding: 1.25rem;
    border-radius: 24px;
  }

  .app-header .container-xl {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  .app-header-quiet .app-header-card {
    padding: 0.7rem 0.85rem;
    border-radius: 18px;
  }

  .app-header-quiet .app-mark {
    gap: 0.65rem;
  }

  .app-header-quiet .app-mark-name {
    font-size: 1rem;
  }

  .app-header-quiet .locale-select {
    min-width: 8.25rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 430px) {
  .hero-actions,
  .action-stack {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions > *,
  .action-stack > *,
  .action-stack .inline-form,
  .action-stack .inline-form > *,
  .shell-form > .shell-button,
  .shell-form > .shell-link,
  .shell-form > .btn {
    width: 100%;
  }

  .recipient-action-grid .shell-panel h2,
  .cabinet-card .support-hint {
    max-width: 32ch;
  }

  .choice-pill,
  .choice-pill span {
    width: 100%;
  }

  .choice-pill span {
    justify-content: center;
  }

  .status-chip {
    width: 100%;
    justify-content: flex-start;
  }
}
