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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--color-ink);
  background:
    radial-gradient(circle at top left, rgba(211, 127, 50, 0.18), transparent 34%),
    linear-gradient(145deg, #f0ebe2 0%, #edf3ef 55%, #f8f4ec 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

img,
svg {
  max-width: 100%;
}

dialog.modal-shell[open] {
  position: fixed;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 auto;
}

dialog.modal-shell > .modal-panel {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@supports not (height: 100dvh) {
  dialog.modal-shell > .modal-panel {
    max-height: calc(100vh - 32px);
  }
}

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

.page-shell--with-tools {
  --header-tool-gap: 6px;
  --header-tools-width: 138px;
}

.page-shell--anonymous {
  padding: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  width: min(1180px, 100%);
  margin: 0 auto 28px;
  min-width: 0;
}

.site-header--with-tools {
  min-height: 72px;
  padding-left: calc(var(--header-tools-width) + 20px);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand strong,
h1,
h2 {
  font-family: var(--font-display);
}

.brand strong {
  font-size: clamp(1.2rem, 1rem + 0.7vw, 1.55rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.brand-kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--color-deep);
}

.page-content {
  max-width: 1180px;
  width: min(1180px, 100%);
  margin: 0 auto;
  min-width: 0;
}

.page-content--anonymous {
  max-width: none;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(20, 33, 31, 0.82);
}

.auth-card,
.dashboard-card,
.hero-panel,
.hero-badge,
.note-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.note-card,
.dashboard-card {
  padding: 22px;
}

.ghost-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(32, 61, 59, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 237, 227, 0.92)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 18px rgba(32, 61, 59, 0.08);
  color: var(--color-deep);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.ghost-button::before,
.danger-button::before {
  content: "";
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  border-radius: 999px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.72rem 0.72rem;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.ghost-button::before {
  background-color: rgba(32, 61, 59, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 10h9m0 0-3.5-3.5M14 10l-3.5 3.5' stroke='%23203d3b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ghost-button--calculator::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Crect x='4.25' y='2.75' width='11.5' height='14.5' rx='2.25' stroke='%23203d3b' stroke-width='1.5'/%3E%3Crect x='6.5' y='5.25' width='7' height='2.5' rx='0.75' fill='%23203d3b' fill-opacity='0.16' stroke='%23203d3b' stroke-width='1.2'/%3E%3Cpath d='M7.1 10.2h.01M10 10.2h.01M12.9 10.2h.01M7.1 12.85h.01M10 12.85h.01M12.9 12.85h.01M7.1 15.5h.01M10 15.5h.01M12.9 15.5h.01' stroke='%23203d3b' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E");
}

.ghost-button--icon-only {
  width: var(--header-tool-size, 54px);
  min-width: var(--header-tool-size, 54px);
  min-height: var(--header-tool-size, 54px);
  padding: 3px;
  gap: 0;
  border-radius: 18px;
}

.ghost-button--icon-only::before {
  display: none;
}

.ghost-button--icon-only img {
  width: 40px;
  height: 40px;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(16, 32, 30, 0.18));
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.ghost-button:hover {
  transform: translateY(-2px);
  border-color: rgba(211, 127, 50, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(247, 239, 226, 0.96)),
    rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 16px 28px rgba(32, 61, 59, 0.12);
  color: #10201e;
}

.ghost-button:hover::before {
  transform: translateX(2px);
  background-color: rgba(211, 127, 50, 0.16);
}

.ghost-button--icon-only:hover img {
  transform: translateY(-1px) scale(1.05) rotate(-4deg);
  filter: drop-shadow(0 10px 16px rgba(16, 32, 30, 0.2));
}

.button-iconized {
  width: 60px !important;
  min-width: 60px !important;
  min-height: 60px !important;
  padding: 3px !important;
  gap: 0 !important;
  border-radius: 20px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  flex: 0 0 auto;
}

.button-iconized::before {
  display: none !important;
}

.button-iconized img {
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(16, 32, 30, 0.18));
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.button-iconized:hover img {
  transform: translateY(-1px) scale(1.05) rotate(-4deg);
  filter: drop-shadow(0 10px 16px rgba(16, 32, 30, 0.2));
}

.ghost-button:focus-visible {
  outline: 3px solid rgba(211, 127, 50, 0.22);
  outline-offset: 3px;
  border-color: rgba(211, 127, 50, 0.36);
}

.ghost-button:active {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 16px rgba(32, 61, 59, 0.1);
}

.danger-button {
  color: #7e2424;
  border-color: rgba(146, 47, 47, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 248, 247, 0.98), rgba(249, 231, 229, 0.95)),
    rgba(255, 240, 238, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 18px rgba(146, 47, 47, 0.08);
}

.danger-button::before {
  background-color: rgba(146, 47, 47, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 6 8 8M14 6l-8 8' stroke='%23922f2f' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.danger-button:hover {
  border-color: rgba(146, 47, 47, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 16px 28px rgba(146, 47, 47, 0.14);
  color: #661818;
}

.danger-button:hover::before {
  transform: rotate(10deg) scale(1.05);
  background-color: rgba(146, 47, 47, 0.16);
}

.mini-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px;
  }

  .page-shell--with-tools {
    --header-tool-gap: 5px;
    --header-tools-width: 132px;
  }

  .page-shell--anonymous {
    padding: 0;
  }

  .site-header {
    gap: 14px;
  }

  .ghost-button {
    width: auto;
    max-width: 100%;
  }

  .site-header--with-tools {
    min-height: 66px;
    padding-left: calc(var(--header-tools-width) + 16px);
  }

  .page-content--anonymous {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .page-shell--with-tools {
    --header-tools-width: 0px;
  }

  .site-header--with-tools {
    min-height: 0;
    padding-left: 0;
    padding-top: 72px;
  }

  .brand-kicker {
    font-size: 0.64rem;
  }

  .lead {
    font-size: 0.98rem;
    line-height: 1.6;
  }
}
