:root {
  /* Saemirae official digital colors: Pantone 2227 C and 2945 C. */
  --party-mint: #51bdc5;
  --party-blue: #1d559c;
  --party-deep: #123765;
  --party-pale: #eef8fa;
  --ink: #143344;
  --muted: #526875;
  --teal: var(--party-blue);
  --line: #d8e5e8;
}
body { background: #f6f9fa; }
#main { max-width: none; padding: 0; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.portal-header { background: white; border-top: 4px solid var(--teal); border-bottom: 1px solid var(--line); }
.portal-header header { height: auto; min-height: 76px; }
.portal-header nav { gap: 24px; }
.portal-header nav a, .brand { padding-block: 8px; }
.portal-header nav a:hover { color: var(--teal); text-decoration: underline; }
.mast { padding-block: 37px 41px; background: #e6f2f3; border-bottom: 1px solid var(--line); }
.mast p { margin: 0; color: var(--muted); line-height: 1.7; }
.mast h1 { font-size: clamp(32px, 5vw, 46px); margin: 0 0 5px; }
.portal-main { padding-block: 24px 40px; }
.portal-notice { background: #fff9eb; border: 1px solid #e5d8b8; border-radius: 8px; color: #554624; padding: 12px 16px; margin: 0 0 24px; font-size: 14px; }
.portal-notice strong { margin-right: 8px; }
.portal-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.box { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.box h2 { font-size: 23px; margin-bottom: 6px; }
.box > p:not(.empty) { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li + li { border-top: 1px solid var(--line); }
.service-row { border: 0; width: 100%; color: var(--ink); background: transparent; text-align: left; padding: 13px 4px; display: flex; gap: 12px; align-items: center; }
.service-row:hover { background: #eef7f8; }
.service-row strong { display: block; font-size: 16px; }
.service-row small { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.service-action { margin-left: auto; flex-shrink: 0; color: var(--teal); font-size: 14px; font-weight: 700; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.quick-links button { min-height: 48px; border-radius: 7px; padding: 9px; border: 1px solid #b8d8da; color: var(--teal); background: #edf7f7; font-weight: 700; font-size: 15px; }
.quick-links button:hover { background: #dceff0; }
.portal-history, .portal-guide { margin-top: 20px; }
.portal-history .section-title { margin-bottom: 12px; align-items: center; flex-direction: row; }
.portal-history .empty { margin-bottom: 0; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.record-actions button:disabled { opacity: .55; cursor: default; }
.record .secondary { align-self: flex-start; }
.portal-guide details { border-top: 1px solid var(--line); padding: 13px 0; }
.portal-guide summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.portal-guide details p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }
footer { background: white; }
[hidden] { display: none !important; }
#staff-view h1 { font-size: clamp(26px, 4vw, 38px); margin: 0; }
#staff-view { min-height: 65vh; }
.address-field { display: flex; gap: 6px; align-items: end; min-width: 0; }
.address-field label { flex: 1; min-width: 0; }
.address-field button { flex-shrink: 0; margin-bottom: 10px; min-height: 44px; padding-inline: 9px; }
#address-lookup { background: white; color: #102b3a; width: min(540px, calc(100% - 28px)); }
#address-lookup .dialog-head { align-items: center; padding: 14px 18px; }
#address-lookup p { margin: 12px 18px; font-size: 14px; }
.address-results:not(:empty) { height: min(440px, 65vh); }
.address-manual { padding: 12px 18px; }
.address-manual label, .address-manual input { margin: 8px 0; }
#application [hidden] { display: none; }
#join-progress { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 14px; list-style: none; padding: 12px 20px; margin: 0; background: #eaf4f5; color: #345460; font-size: 14px; }
#join-progress [aria-current="step"] { color: #06434b; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.join-terms { margin: 12px 0; padding: 14px; border: 1px solid #b9cdd2; border-radius: 8px; background: #f7fbfc; color: #102b3a; font-size: 15px; line-height: 1.65; }
.join-terms summary { cursor: pointer; font-weight: 700; }
.join-terms dt { margin-top: 12px; }
.join-terms dd { margin: 4px 0 0; }
#application,
#application .dialog-head,
#application #dialog-body {
  color-scheme: light;
  background-color: #fff;
  color: #102b3a;
}
#application .fields label {
  background-color: #f2f7f8;
  border-radius: 8px;
  padding: 8px 10px 10px;
}
#application .fields label {
  color: #102b3a;
  font-size: 16px;
  font-weight: 700;
}
#application .fields :is(input, select, textarea) {
  color: #102b3a;
  background: #fff;
  border-color: #83949e;
  font-weight: 400;
}
#application .fields :is(input, textarea)::placeholder {
  color: #536573;
  opacity: 1;
}
#application .review dt,
#application .check {
  color: #102b3a;
  font-weight: 700;
}
.portal-header { border-top: 0; }
.portal-header header { min-height: 74px; }
.party-brand { display: block; line-height: 1; }
.party-logo { display: block; width: clamp(145px,22vw,208px); max-width: 100%; height: auto; }
.portal-header nav a { color: #315463; }
.mast { padding: 24px 24px 0; background: transparent; border: 0; }
.mast-inner { display: grid; grid-template-columns: 1.15fr 1fr; position: relative; isolation: isolate; overflow: hidden; min-height: 330px; padding: 39px 52px; border-radius: 24px; background: radial-gradient(ellipse at 95% 0%,#248987 0%,transparent 60%),linear-gradient(117deg,#092d3f,#0c4f5b 66%,#116969); color: white; }
.mast-copy { z-index: 1; }
.mast h1 { font-size: clamp(38px,5vw,56px); letter-spacing: -.055em; line-height: 1.16; margin: 12px 0 16px; }
.mast p { color: #dcecee; max-width: 29rem; }
.preview-label { display: inline-block; border: 1px solid #9de4dd70; background: #ffffff12; border-radius: 30px; padding: 4px 11px; color: #d1f7f2; font-size: 13px; font-weight: 700; }
.mast-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.mast-actions a { min-height: 44px; background: #bdf3e8; color: #103e44; padding: 11px 17px; border-radius: 8px; font-size: 15px; font-weight: 700; }
.mast-actions a + a { background: transparent; border: 1px solid #a4d5d9; color: #fff; }
.mast-actions a:hover { filter: brightness(1.12); }
.mast-art { display: grid; place-items: center; position: relative; }
.mast-art::before { content: ""; position: absolute; width: 370px; aspect-ratio: 1; border-radius: 50%; border: 1px solid #a0e8df40; box-shadow: 0 0 0 35px #a0e8df13,0 0 0 71px #a0e8df0d; }
.card-back,.member-card { grid-area: 1/1; width: clamp(195px,24vw,285px); aspect-ratio: 1.62; border-radius: 18px; }
.card-back { transform: translate(18px,10px) rotate(15deg); background: #64c8bd50; border: 1px solid #b5f8ef60; }
.member-card { position: relative; display: grid; grid-template-columns: 26px 1fr; align-content: center; align-items: center; gap: 8px 12px; padding: 24px; overflow: hidden; background: linear-gradient(135deg,#ecfffb,#91dfd4); color: #153d47; box-shadow: 0 18px 35px #051f344e; transform: translate(-12px,-6px) rotate(-9deg); }
.member-card::after { content: ""; position: absolute; width: 150px; height: 150px; bottom: -82px; right: -26px; border: 1px solid #168b894d; border-radius: 50%; box-shadow: 0 0 0 17px #168b8918, 0 0 0 34px #168b890d; }
.member-card .party-brand { grid-column: 1/-1; padding: 9px 10px; border-radius: 7px; background: white; }
.member-card-rule { display: block; grid-column: 1/-1; width: 65%; height: 4px; border-radius: 5px; background: #28646d44; }
.member-card-rule:last-child { width: 42%; }
.portal-main { padding-top: 18px; }
.portal-notice { background: #edf4f6; border-color: #d5e5e9; color: #345460; }
.portal-grid { grid-template-columns: 1.4fr 1fr; }
.box { border-radius: 16px; box-shadow: 0 7px 20px #21445009; }
.service-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.service-list li + li { border-top: 0; }
.service-row { position: relative; display: grid; align-content: start; min-height: 124px; height: 100%; gap: 5px; border: 1px solid #dce9ec; border-radius: 11px; padding: 13px; }
.service-row:hover { border-color: #79adaf; }
.service-row::before { content: "+"; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #e5f4f1; color: #006b70; font-size: 19px; font-weight: 700; }
.service-row[data-type="rejoin"]::before { content: "↻"; }
.service-row[data-type="transfer"]::before { content: "⇄"; }
.service-row[data-type="leave"]::before { content: "−"; }
.service-row[data-type="join"] { background: #edf8f6; }
.service-action { margin: 1px 0 0; font-size: 13px; }
.quick-links button { min-height: 62px; border-color: #d3e7e7; background: #f2f9f8; }
.portal-header { border-top: 4px solid var(--party-mint); }
.portal-header nav a { color: var(--party-blue); }
.mast-inner { background: linear-gradient(118deg,var(--party-deep),var(--party-blue)); }
.mast-actions a { background: var(--party-mint); color: #102b3a; }
.mast-actions a + a { background: transparent; color: white; }
.card-back { background: var(--party-mint); border-color: #b1e4e8; }
.member-card { background: linear-gradient(135deg,#fff,#d0eff2); }
.portal-notice,.service-row[data-type="join"],.quick-links button,
.form-note,#join-progress,#application .fields label { background: var(--party-pale); }
.service-row::before { background: var(--party-mint); color: #102b3a; }
.service-action,.quick-links button,#join-progress [aria-current="step"] { color: var(--party-blue); }
.quick-links button:hover,.service-row:hover { background: #dff2f5; }
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline: 3px solid var(--party-blue);
  outline-offset: 3px;
}
.mast-actions a:focus-visible { outline-color: white; }
@media(max-width: 800px) { .mast-inner { padding: 34px; } }
@media(max-width: 700px) {
  .wrap { padding-inline: 16px; }
  .portal-header header { padding-block: 9px; gap: 4px; }
  .portal-header nav { width: 100%; justify-content: space-between; gap: 8px; }
  .mast { padding: 14px 16px 0; }
  .mast .mast-inner { grid-template-columns: 1fr; min-height: 0; padding: 26px 24px; border-radius: 17px; }
  .mast-art { display: none; }
  .portal-grid { grid-template-columns: 1fr; gap: 15px; }
  .box { padding: 17px; }
}

.address-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.address-tools a { display: inline-block; }
