:root {
  --ink: #101820;
  --ink-soft: #2e3335;
  --cream: #f7f1e7;
  --cream-bright: #fffdf8;
  --gold: #c7a45f;
  --gold-deep: #927735;
  --gold-soft: #dfcfac;
  --line: rgba(170, 132, 59, 0.7);
  --line-soft: rgba(170, 132, 59, 0.36);
  --white: #ffffff;
  --shadow: 0 20px 52px rgba(37, 31, 17, 0.13);
  --radius: 8px;
  --header-height: 96px;
  --nav-height: 60px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, Montserrat, Arial, sans-serif;
  line-height: 1.42;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

a {
  text-decoration: none;
}

button,
a[href] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(146, 119, 53, 0.48);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.portal-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background-image: url("assets/portal-villa.webp");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.portal-shell::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(252, 248, 240, 0.97) 0%,
    rgba(252, 248, 240, 0.93) 56%,
    rgba(252, 248, 240, 0.74) 100%
  );
}

.portal-header,
.portal-main,
.bottom-nav {
  position: relative;
  z-index: 1;
}

.portal-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 5.6vw 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.brand img {
  width: 47px;
  height: 47px;
  object-fit: contain;
}

.brand span {
  color: var(--gold);
  font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
  font-size: 24px;
  letter-spacing: 5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.quick-tools {
  display: grid;
  grid-template-columns: repeat(5, 98px);
  min-height: 72px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 252, 246, 0.88);
  box-shadow: 0 10px 36px rgba(43, 35, 20, 0.08);
  backdrop-filter: blur(12px);
}

.quick-tools a,
.quick-tools button {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
}

.quick-tools a + a::before,
.quick-tools a + button::before,
.quick-tools button + a::before,
.quick-tools button + button::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 1px;
  content: "";
  background: var(--line);
}

.quick-tools svg {
  width: 27px;
  height: 27px;
  stroke-width: 2;
}

.quick-tools span {
  font-size: 13px;
  font-weight: 700;
}

.quick-tools a:hover,
.quick-tools button:hover {
  color: var(--gold-deep);
  background: rgba(199, 164, 95, 0.1);
}

.portal-main {
  min-height: calc(100dvh - var(--header-height));
  padding: 0 5.6vw calc(var(--nav-height) + 24px);
}

.session-bar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  margin-top: -5px;
  padding-bottom: 6px;
}

.session-bar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.session-bar p > span {
  margin-left: 8px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.session-bar form {
  margin: 0;
}

.session-bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0 5px 8px;
  background: transparent;
  color: var(--gold-deep);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.session-bar button:hover {
  color: var(--ink);
}

.session-bar svg {
  width: 15px;
  height: 15px;
}

.portal-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-height) - var(--nav-height) - 62px);
  animation: reveal 240ms ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-intro {
  width: min(690px, 61vw);
  padding: 1px 0 26px;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.view-intro h1 {
  margin: 0;
  font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
  font-size: clamp(42px, 4.1vw, 61px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.gold-rule {
  display: block;
  width: 84px;
  height: 3px;
  margin: 22px 0 17px;
  background: var(--gold);
}

.view-description {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.45vw, 21px);
  letter-spacing: 0;
}

.home-intro {
  padding-bottom: 25px;
}

.home-board,
.module-board,
.utilities-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 252, 247, 0.91);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.home-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  padding: 24px;
}

.home-card,
.module-card,
.team-card,
.utility-card,
.reference-list :is(button, a) {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.92);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.home-card:hover,
.module-card:hover,
.team-card:hover,
.utility-card:hover,
.reference-list :is(button, a):hover {
  border-color: var(--gold-deep);
  background: var(--white);
  box-shadow: 0 13px 28px rgba(68, 51, 18, 0.1);
  transform: translateY(-2px);
}

.home-card {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: start;
  padding: 24px 32px 28px;
  text-align: center;
}

.home-card .card-title {
  font-size: clamp(23px, 2.3vw, 31px);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card-rule {
  width: 58%;
  height: 1px;
  margin: 9px auto 23px;
  background: var(--gold);
}

.home-card > svg:not(.card-arrow) {
  width: 92px;
  height: 92px;
  color: var(--gold);
  stroke-width: 1.35;
}

.home-card .card-copy {
  max-width: 290px;
  margin-top: 21px;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.35;
}

.card-arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 30px;
  height: 30px;
  color: var(--gold);
  stroke-width: 1.6;
}

.module-board {
  margin-top: auto;
  padding: 18px 30px 27px;
}

.board-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.board-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  color: var(--gold);
}

.board-icon svg {
  width: 52px;
  height: 52px;
  stroke-width: 1.5;
}

.board-heading h2,
.utility-heading h2 {
  margin: 0;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.board-heading p {
  margin: 1px 0 0;
  font-size: 14px;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding-top: 20px;
}

.module-card {
  min-height: 119px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 18px 40px 18px 18px;
  text-align: left;
}

.module-card > svg:not(.card-arrow) {
  width: 57px;
  height: 57px;
  color: var(--gold);
  stroke-width: 1.45;
}

.module-card span {
  min-width: 0;
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.25;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 20px;
}

.team-card {
  min-height: 248px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  padding: 28px 42px;
}

.team-card > svg:not(.card-arrow) {
  width: 112px;
  height: 112px;
  color: var(--gold);
  stroke-width: 1.3;
}

.team-card span {
  font-size: clamp(18px, 1.7vw, 22px);
  text-align: center;
}

.utilities-intro {
  padding-bottom: 18px;
}

.utilities-board {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr);
  gap: 28px;
  margin-top: auto;
  padding: 20px 30px 28px;
}

.utility-section + .utility-section {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.utility-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}

.utility-heading > svg {
  width: 57px;
  height: 57px;
  color: var(--gold);
  stroke-width: 1.45;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
  padding-top: 20px;
}

.utility-card {
  min-height: 117px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 17px 42px 17px 24px;
  color: var(--gold-deep);
  text-align: left;
}

.utility-card > svg:not(.card-arrow) {
  width: 61px;
  height: 61px;
  color: var(--gold-deep);
  stroke-width: 1.45;
}

.utility-card span {
  font-size: clamp(17px, 1.55vw, 21px);
}

.reference-list {
  display: grid;
  gap: 13px;
  padding-top: 20px;
}

.reference-list :is(button, a) {
  min-height: 74px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px 42px 12px 18px;
  text-align: left;
}

.reference-list :is(button, a) > svg:not(.card-arrow) {
  width: 43px;
  height: 43px;
  color: var(--gold);
  stroke-width: 1.45;
}

.reference-list :is(button, a) span {
  font-size: clamp(16px, 1.4vw, 20px);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: var(--nav-height);
  border-top: 1px solid rgba(146, 119, 53, 0.18);
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 17px;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease;
}

.bottom-nav svg {
  display: none;
  width: 22px;
  height: 22px;
}

.bottom-nav button:hover {
  background: rgba(199, 164, 95, 0.13);
}

.bottom-nav button.is-active {
  background: var(--gold-deep);
  color: var(--white);
  font-weight: 700;
}

.module-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--cream-bright);
  box-shadow: 0 32px 90px rgba(15, 20, 16, 0.28);
}

.module-dialog::backdrop {
  background: rgba(12, 18, 15, 0.62);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(200px, 1fr) auto;
  max-height: min(760px, calc(100dvh - 32px));
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 19px;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold-deep);
}

.dialog-icon svg {
  width: 28px;
  height: 28px;
}

.dialog-title-group p {
  margin: 0 0 2px;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.dialog-title-group h2 {
  margin: 0;
  font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 400;
  line-height: 1;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.icon-button:hover {
  color: var(--white);
  background: var(--gold-deep);
}

.dialog-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 24px;
  padding: 21px 28px;
  background: rgba(199, 164, 95, 0.08);
}

.dialog-summary p,
.dialog-summary blockquote {
  margin: 0;
}

.dialog-summary p {
  font-size: 16px;
}

.dialog-summary blockquote {
  padding-left: 18px;
  border-left: 3px solid var(--gold);
  color: var(--gold-deep);
  font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
  font-size: 18px;
  font-style: italic;
}

.dialog-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 28px 0;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-tabs button {
  min-height: 43px;
  padding: 10px 17px;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #66645e;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.dialog-tabs button.is-active {
  border-color: var(--gold-deep);
  color: var(--ink);
}

.dialog-content {
  min-height: 230px;
  overflow: auto;
  padding: 24px 28px 30px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--line-soft);
}

.overview-grid article {
  min-height: 130px;
  padding: 20px;
  background: var(--cream-bright);
}

.overview-grid span {
  display: block;
  margin-bottom: 11px;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.overview-grid p {
  margin: 0;
  font-size: 15px;
}

.module-resources {
  margin-top: 25px;
}

.resource-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.resource-heading span {
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.resource-heading h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 650;
}

.resource-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

.resource-links a {
  min-width: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.resource-links a:hover strong {
  color: var(--gold-deep);
}

.resource-links a > span {
  min-width: 0;
}

.resource-links strong,
.resource-links small {
  display: block;
  overflow-wrap: anywhere;
}

.resource-links strong {
  font-size: 14px;
}

.resource-links small {
  margin-top: 2px;
  color: #706d66;
  font-size: 12px;
}

.resource-links svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--gold-deep);
}

.process-list,
.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-list {
  counter-reset: process;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.process-list li {
  counter-increment: process;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 58px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.process-list li::before {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  content: counter(process, decimal-leading-zero);
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
}

.process-list strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
}

.process-list span {
  color: #65645f;
  font-size: 13px;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 48px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.checklist input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--gold-deep);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 65px;
  padding: 12px 28px;
  border-top: 1px solid var(--line-soft);
}

.dialog-footer span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.dialog-footer svg {
  width: 18px;
  height: 18px;
}

.text-button {
  min-height: 40px;
  padding: 9px 19px;
  border-radius: var(--radius);
  background: var(--gold-deep);
  color: var(--white);
  cursor: pointer;
  font-weight: 750;
}

.currency-dialog {
  width: min(900px, calc(100vw - 32px));
}

.currency-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.currency-content {
  min-height: 0;
  overflow: auto;
  padding: 25px 28px 30px;
}

.currency-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.currency-kicker {
  margin: 0 0 3px;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.currency-intro h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.refresh-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold-deep);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.refresh-button:hover {
  background: rgba(199, 164, 95, 0.1);
}

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

.refresh-button svg {
  width: 17px;
  height: 17px;
}

.refresh-button.is-loading svg {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.converter-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  padding: 28px 0 24px;
}

.currency-field {
  min-width: 0;
}

.currency-field > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: #696760;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.currency-input {
  min-width: 0;
  height: 64px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.currency-input:focus-within {
  outline: 3px solid rgba(146, 119, 53, 0.25);
  outline-offset: 2px;
}

.currency-input strong,
.currency-input select {
  width: 86px;
  flex: 0 0 86px;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: rgba(199, 164, 95, 0.1);
  color: var(--gold-deep);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.currency-input select {
  padding: 0 10px;
  cursor: pointer;
}

.currency-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0 15px;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
}

.conversion-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: var(--gold-deep);
}

.conversion-arrow svg {
  width: 24px;
  height: 24px;
}

.currency-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--line-soft);
}

.currency-breakdown div {
  min-width: 0;
  min-height: 92px;
  padding: 17px;
  background: var(--cream-bright);
}

.currency-breakdown dt {
  margin-bottom: 8px;
  color: #6b6861;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.currency-breakdown dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 750;
}

.currency-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.currency-status-row p {
  margin: 0;
  color: #66645e;
  font-size: 13px;
}

.currency-status-row a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 750;
}

.currency-status-row svg {
  width: 16px;
  height: 16px;
}

.currency-notice {
  margin: 17px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  background: rgba(199, 164, 95, 0.09);
  color: #595750;
  font-size: 13px;
}

.login-page {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--cream) url("assets/portal-villa.webp") center / cover fixed;
}

.login-page::before {
  position: fixed;
  inset: 0;
  content: "";
  background: linear-gradient(
    90deg,
    rgba(251, 247, 239, 0.98) 0%,
    rgba(251, 247, 239, 0.92) 48%,
    rgba(25, 28, 25, 0.46) 100%
  );
}

.login-layout {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  align-items: center;
  gap: clamp(40px, 8vw, 130px);
  padding: clamp(34px, 6vw, 86px);
}

.login-brand {
  max-width: 640px;
}

.login-brand img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.login-brand > p:first-of-type {
  margin: 18px 0 24px;
  color: var(--gold-deep);
  font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
  font-size: 18px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.login-brand h1 {
  margin: 0;
  font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
  font-size: clamp(58px, 7vw, 98px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: uppercase;
}

.login-brand > span {
  display: block;
  width: 92px;
  height: 3px;
  margin: 30px 0 22px;
  background: var(--gold);
}

.login-brand > p:last-child {
  max-width: 570px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(18px, 1.6vw, 23px);
}

.login-panel {
  width: 100%;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 28px 75px rgba(20, 21, 17, 0.22);
  backdrop-filter: blur(16px);
}

.login-panel-heading {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.login-panel-heading p {
  margin: 0 0 4px;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.login-panel-heading h2 {
  margin: 0;
  font-family: Baskerville, "Baskerville Old Face", Georgia, serif;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 0;
}

.login-error {
  margin: 18px 0 0;
  padding: 11px 13px;
  border-left: 3px solid #9b3f36;
  background: rgba(155, 63, 54, 0.08);
  color: #6f2f29;
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 20px;
  margin-top: 25px;
}

.login-form label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: #5e5c56;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.login-form select,
.login-form input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.login-form select {
  padding: 0 14px;
  cursor: pointer;
}

.login-form input {
  padding: 0 51px 0 14px;
}

.login-form select:focus,
.login-form input:focus {
  outline: 3px solid rgba(146, 119, 53, 0.25);
  outline-offset: 2px;
}

.password-control {
  position: relative;
  display: block;
}

.password-control button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  color: var(--gold-deep);
  cursor: pointer;
}

.password-control button:hover {
  background: rgba(199, 164, 95, 0.12);
}

.password-control svg {
  width: 20px;
  height: 20px;
}

.login-submit {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--gold-deep);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
}

.login-submit:hover {
  background: #776027;
}

.login-submit svg {
  width: 20px;
  height: 20px;
}

.login-support {
  margin: 22px 0 0;
  color: #706d66;
  font-size: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: calc(var(--nav-height) + 20px);
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  :root {
    --header-height: 88px;
  }

  .portal-header,
  .portal-main {
    padding-left: 32px;
    padding-right: 32px;
  }

  .brand span {
    font-size: 19px;
    letter-spacing: 3px;
  }

  .quick-tools {
    grid-template-columns: repeat(5, 74px);
    min-height: 64px;
  }

  .operations-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .utilities-board {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  }

  .utility-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .login-layout {
    gap: 48px;
    padding-left: 38px;
    padding-right: 38px;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: auto;
    --nav-height: 68px;
  }

  .portal-shell {
    overflow: visible;
    background-attachment: scroll;
  }

  .portal-header {
    height: auto;
    align-items: stretch;
    padding: 15px 18px 10px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  .brand span {
    display: none;
  }

  .quick-tools {
    grid-template-columns: repeat(5, minmax(50px, 1fr));
    width: min(100%, 390px);
    min-height: 58px;
  }

  .quick-tools svg {
    width: 22px;
    height: 22px;
  }

  .quick-tools span {
    font-size: 10px;
  }

  .portal-main {
    min-height: calc(100dvh - 83px);
    padding: 10px 18px calc(var(--nav-height) + 20px);
  }

  .session-bar {
    justify-content: space-between;
    margin-top: -4px;
    padding-bottom: 10px;
  }

  .portal-view {
    min-height: calc(100dvh - 156px - var(--nav-height));
  }

  .view-intro {
    width: 100%;
    padding-bottom: 20px;
  }

  .section-kicker {
    margin-bottom: 5px;
  }

  .view-intro h1 {
    font-size: clamp(38px, 11vw, 52px);
  }

  .gold-rule {
    margin: 15px 0 13px;
  }

  .view-description {
    font-size: 16px;
  }

  .home-board,
  .team-grid,
  .utilities-board {
    grid-template-columns: 1fr;
  }

  .home-board {
    gap: 12px;
    padding: 13px;
  }

  .home-card {
    min-height: 150px;
    grid-template-columns: 76px minmax(0, 1fr);
    align-content: center;
    justify-items: start;
    gap: 4px 18px;
    padding: 18px 44px 18px 18px;
    text-align: left;
  }

  .home-card .card-title {
    grid-column: 2;
    font-size: 22px;
  }

  .home-card .card-rule {
    display: none;
  }

  .home-card > svg:not(.card-arrow) {
    grid-row: 1 / span 2;
    width: 65px;
    height: 65px;
  }

  .home-card .card-copy {
    grid-column: 2;
    margin: 0;
    font-size: 15px;
  }

  .module-board,
  .utilities-board {
    margin-top: 0;
    padding: 14px;
  }

  .board-heading {
    min-height: 68px;
  }

  .board-heading p {
    display: none;
  }

  .operations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    padding-top: 14px;
  }

  .module-card {
    min-height: 115px;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px;
    padding: 14px 30px 14px 12px;
  }

  .module-card > svg:not(.card-arrow) {
    width: 44px;
    height: 44px;
  }

  .module-card span {
    font-size: 15px;
  }

  .team-grid {
    gap: 11px;
    padding-top: 14px;
  }

  .team-card {
    min-height: 128px;
    grid-template-columns: 78px minmax(0, 1fr);
    justify-items: start;
    gap: 16px;
    padding: 17px 44px 17px 20px;
  }

  .team-card > svg:not(.card-arrow) {
    width: 68px;
    height: 68px;
  }

  .team-card span {
    text-align: left;
  }

  .utilities-board {
    gap: 22px;
  }

  .utility-section + .utility-section {
    padding: 0;
    border-left: 0;
  }

  .systems-grid {
    gap: 11px;
  }

  .utility-card {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 96px;
    gap: 9px;
    padding: 12px 32px 12px 12px;
  }

  .utility-card > svg:not(.card-arrow) {
    width: 40px;
    height: 40px;
  }

  .utility-card span,
  .reference-list :is(button, a) span {
    font-size: 15px;
  }

  .bottom-nav button {
    flex-direction: column;
    gap: 2px;
    padding: 7px 4px 5px;
    font-size: 10px;
  }

  .bottom-nav svg {
    display: block;
  }

  .module-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .dialog-shell {
    max-height: calc(100dvh - 16px);
  }

  .dialog-header,
  .dialog-summary,
  .dialog-content,
  .dialog-footer {
    padding-left: 19px;
    padding-right: 19px;
  }

  .dialog-summary {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dialog-tabs {
    padding-left: 19px;
    padding-right: 19px;
  }

  .overview-grid,
  .process-list,
  .checklist {
    grid-template-columns: 1fr;
  }

  .resource-links {
    grid-template-columns: 1fr;
  }

  .currency-content {
    padding-left: 19px;
    padding-right: 19px;
  }

  .currency-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-page::before {
    background: rgba(251, 247, 239, 0.92);
  }

  .login-layout {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 30px;
    padding: 34px 24px;
  }

  .login-brand,
  .login-panel {
    width: min(100%, 540px);
    margin: 0 auto;
  }

  .login-brand img {
    width: 54px;
    height: 54px;
  }

  .login-brand > p:first-of-type {
    margin: 8px 0 12px;
    font-size: 14px;
  }

  .login-brand h1 {
    font-size: 52px;
  }

  .login-brand > span {
    width: 70px;
    margin: 18px 0 13px;
  }

  .login-brand > p:last-child {
    font-size: 16px;
  }
}

@media (max-width: 470px) {
  .portal-header {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .quick-tools {
    width: calc(100% - 48px);
    min-height: 54px;
  }

  .quick-tools a,
  .quick-tools button {
    padding: 6px 3px;
  }

  .portal-main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .session-bar p > span {
    display: none;
  }

  .session-bar button span {
    display: none;
  }

  .home-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .home-card > svg:not(.card-arrow) {
    width: 52px;
    height: 52px;
  }

  .operations-grid,
  .systems-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 91px;
  }

  .dialog-title-group {
    gap: 10px;
  }

  .dialog-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .dialog-tabs {
    gap: 0;
  }

  .dialog-tabs button {
    flex: 1;
    padding-left: 8px;
    padding-right: 8px;
  }

  .currency-intro,
  .currency-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .converter-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .conversion-arrow {
    margin: -2px auto;
    transform: rotate(90deg);
  }

  .currency-breakdown {
    grid-template-columns: 1fr;
  }

  .currency-input input {
    font-size: 21px;
  }

  .resource-heading > span:last-child {
    display: none;
  }

  .login-layout {
    align-content: start;
    gap: 24px;
    padding: 24px 14px;
  }

  .login-brand h1 {
    font-size: 44px;
  }

  .login-brand > p:last-child {
    max-width: 350px;
    font-size: 15px;
  }

  .login-panel {
    padding: 25px 20px;
  }

  .login-panel-heading h2 {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
