/* Visual overrides only. The original application, data and print styles stay intact. */
@font-face {
  font-family: 'Pretendard Variable';
  src: url('/assets/PretendardVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@media screen {
  :root {
    --primary: #4b60db;
    --soft: #eef0ff;
    --bg: #f7f8fc;
    --surface: #fff;
    --ink: #242c44;
    --muted: #69728a;
    --line: #e5e8f1;
    --radius: 16px;
    --small-radius: 8px;
  }
  body { background: var(--bg); color: var(--ink); font-size: 15px; }
  button, input, select, textarea { font: inherit; }
  h1, h2, h3 { color: var(--ink); letter-spacing: -.035em; }
  h1 { font-size: clamp(24px, 2.15vw, 32px); font-weight: 730; line-height: 1.35; }
  :focus-visible { outline: 3px solid #4b60db; outline-offset: 3px; }
  .skip { left: 8px; }
  .sidebar { padding-top: 22px; padding-bottom: 22px; border-color: var(--line); }
  .sidebar-head { margin-bottom: 16px; }
  @media (min-width: 761px) {
    .sidebar:not(.collapsed) .nav-link { padding-inline: 12px; }
    .sidebar .nav-icon svg { width: 24px; height: 24px; stroke-width: 1.8; }
    .sidebar:has(~ .workspace .topbar .account) .sidebar-head { margin-bottom: -15px; }
    .sidebar:has(~ .workspace .topbar .account) .sidebar-head :is(.sidebar-toggle, .brand) { translate: 0 -4px; }
  }
  .sidebar-head .brand { padding-top: 8px; }
  .nav-link { min-height: 46px; margin: 5px 0; border-radius: 10px; color: #657087; font-size: 13px; font-weight: 500; }
  .nav-link.active { background: var(--soft); color: #465bd0; font-weight: 700; }
  .nav-link:hover { background: #f3f4fb; }
  .sidebar.collapsed :is(.nav-link, .btn.sidebar-toggle) {
    width: 48px;
    min-height: 46px;
    border-radius: 10px;
  }
  .nav-icon svg { width: 21px; height: 21px; stroke-width: 1.65; }
  .sidebar-footer { background: #f6f7fb; color: #69728a; padding: 14px; line-height: 1.8; }
  .sidebar.collapsed .nav-link::after { background: #303b62; box-shadow: none; }
  .account .avatar { background: #eef0ff; color: #4b60db; }
  main { max-width: 1440px; padding: 34px 40px; }
  .btn { min-height: 40px; padding: 9px 16px; border-radius: 8px; font-weight: 600; box-shadow: none; }
  .btn.primary { background: #5368e6; border-color: #5368e6; color: #fff; }
  .btn.primary:hover { background: #4257cd; border-color: #4257cd; }
  .btn.ghost { color: #59657e; background: #fff; border-color: #dce1ef; }
  .btn.ghost:hover { color: #3b50c7; background: #f5f6ff; }
  .btn:disabled { cursor: not-allowed; }
  .btn.sidebar-toggle { background: transparent; border: 0; }
  .btn.sidebar-toggle:hover { color: var(--ink); background: transparent; }
  .panel, .service, .room-card, .stat { border-color: var(--line); box-shadow: none; border-radius: 16px; }
  .panel { padding: 24px; }
  .page-heading { margin-bottom: 26px; gap: 20px; }
  .page-heading > .btn, .plans-heading .btn { flex-shrink: 0; white-space: nowrap; }
  .page-heading p { margin-top: 9px; color: var(--muted); }
  .eyebrow { color: #6874aa; font-size: 10px; font-weight: 650; letter-spacing: .16em; }
  .welcome { background: #283448; border: 1px solid #e3e6fb; border-radius: 18px; }
  .welcome h1 { font-size: clamp(24px, 2.1vw, 31px); }
  .welcome p { color: var(--ink); }

  .section-title { margin: 28px 0 18px; }
  .section-title h2 { font-size: 19px; }
  .services { gap: 18px; }
  .service { min-height: 170px; padding: 24px; background: #fff; border: 1px solid var(--line); transition: border-color .15s ease, background .15s ease; }
  .service.featured { border-top: 1px solid var(--line); }
  .service:hover { transform: none; border-color: #acb6f0; background: #fcfcff; box-shadow: none; }
  .service-icon { width: 30px; height: 30px; padding: 0; border-radius: 0; background: transparent; color: #6375dc; }
  .service-icon svg { width: 25px; height: 25px; }
  .service h3 { margin-top: 20px; font-size: 16px; }
  .service p { font-size: 13px; line-height: 1.7; color: var(--muted); }
  .footer-note { margin-top: 32px; color: #6c758d; font-size: 10px; letter-spacing: .03em; }
  .stats { gap: 16px; }
  .stat { padding: 21px 24px; }
  .stat strong { font-weight: 600; }
  .tabs { gap: 6px; border-color: var(--line); }
  .tab { min-height: 44px; padding: 11px 17px; font-size: 14px; }
  .tab.active { color: var(--primary); border-color: var(--primary); }
  .filters { gap: 18px; }
  input, select, textarea { border-color: #dce1ed; border-radius: 8px; background-color: #fff; color: var(--ink); }
  input:focus, select:focus, textarea:focus { border-color: #7485e5; }
  .room-card { padding: 19px; border-radius: 12px; }
  .room-card:hover { transform: none; box-shadow: none; border-color: #acb6f0; }
  .floor { border-color: var(--line); }
  .badge { border-radius: 6px; font-weight: 600; }
  .empty { padding: 42px 20px; color: #778097; }
  dialog { border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 72px #2028492b; }
  dialog::backdrop { background: #1d254f66; }
  .dialog-head { border-color: var(--line); padding: 22px 24px; }
  .dialog-head h2 { font-size: 21px; }
  .dialog-body { padding: 24px; }
  #toast { background: #303b62; border-radius: 10px; }
  .record-guide { --rg-primary: #4b60db; }
  .record-guide .panel { box-shadow: none; }

  /* Original authentication form and controls remain in their original DOM. */
  main:has(.auth-panel) {
    position: relative;
    isolation: isolate;
    max-width: none;
    min-height: calc(100vh - 80px);
    padding: 70px 47% 40px 5.5%;
    background: #607af5;
  }
  main:has(.auth-panel)::before {
    position: absolute; z-index: -2; inset: 0 44% 0 0;
    content: ''; background: #fff; border-radius: 0 28px 28px 0;
  }
  main:has(.auth-panel)::after {
    position: absolute; z-index: -1; inset: 7% 2.5% 7% 58%;
    content: ''; background: url('/assets/school-work.svg') center / 115% auto no-repeat;
  }
  .auth-panel {
    width: 100%; max-width: 410px; margin: 0 auto; padding: 28px 0;
    border: 0; border-radius: 0; background: #fff; box-shadow: none;
  }
  .auth-panel .eyebrow { margin-bottom: 19px; color: #5b6ba6; }
  .auth-panel h1 { font-size: 34px; font-weight: 750; line-height: 1.4; }
  .auth-intro { margin: 16px 0 32px; color: #69748f; line-height: 1.8; }
  .auth-form fieldset { gap: 24px; }
  .auth-field { gap: 9px; }
  .auth-field label { font-size: 12px; color: #69748f; font-weight: 500; }
  .auth-field input { min-height: 48px; padding: 10px 0; border: 0; border-bottom: 1px solid #dce1f2; border-radius: 0; background: transparent; }
  .auth-field input:focus { outline-offset: 3px; border-color: #607af5; }
  .password-control input { padding-right: 66px; }
  .password-control .password-toggle { border: 0; color: #6573a7; background: transparent; min-height: 36px; }
  .auth-submit { min-height: 48px; margin-top: 10px; }
  .auth-help { margin-top: 28px; padding-top: 20px; border-color: #edf0f7; color: #707b96; font-size: 12px; line-height: 1.9; }
  .auth-panel > .btn { font-size: 12px; }
  .auth-error { color: #b43548; font-size: 13px; }
  main:has(.auth-panel) > .footer-note { max-width: 410px; margin: 30px auto 0; text-align: left; background: #fff; }

  @media (max-width: 1100px) and (min-width: 761px) {
    main { padding: 28px 26px; }
    .sidebar:has(~ .workspace .topbar .account) .sidebar-head { margin-bottom: -21px; }
    .panel { padding: 20px; }
    .service { padding: 22px; }
    main:has(.auth-panel) { padding: 40px 28px; background: #fff; }
    main:has(.auth-panel)::before, main:has(.auth-panel)::after { display: none; }
    .auth-panel { max-width: 400px; }
  }
  @media (max-width: 1100px) {
    .plans-month-head { flex-direction: column; align-items: stretch; }
    .plans-month-head .plans-goal { flex-wrap: wrap; row-gap: 10px; }
    .plans-month-head .plans-goal > strong { flex-basis: 100%; line-height: 1.7; }
    .facility-history-table { min-width: 720px; }
  }
  @media (max-width: 760px) {
    body { font-size: 14px; }
    .sidebar { padding-top: 18px; box-shadow: none; }
    .sidebar.open { box-shadow: 12px 0 40px #20284924; }
    .sidebar-head { margin-bottom: 8px; }
    main { padding: 24px 18px; }
    .page-heading { align-items: flex-start; flex-wrap: wrap; margin-bottom: 22px; gap: 14px; }
    .page-heading h1 { font-size: 24px; }
    .page-heading p { font-size: 13px; line-height: 1.7; }
    .welcome h1 { font-size: clamp(19px, 6vw, 24px); line-height: 1.35; }
    .section-title { margin-top: 27px; align-items: flex-start; gap: 8px; }
    .section-title h2 { font-size: 18px; }
    .section-title p { font-size: 11px; }
    .services { gap: 12px; }
    .service { min-height: 170px; padding: 20px 17px; }
    .service h3 { font-size: 15px; line-height: 1.5; }
    .service p { font-size: 12px; }
    .panel { padding: 18px; border-radius: 14px; }
    .stats { gap: 8px; }
    .stat { padding: 16px 12px; border-radius: 12px; }
    .filters { gap: 12px; }
    .tab { min-height: 44px; padding: 11px 14px; font-size: 13px; }
    .room-card { padding: 16px; }
    .dialog-head, .dialog-body { padding: 20px; }
    main:has(.auth-panel) { min-height: calc(100vh - 70px); padding: 30px 26px; background: #fff; }
    main:has(.auth-panel)::before, main:has(.auth-panel)::after { display: none; }
    .auth-panel { padding: 20px 0; }
    .auth-panel h1 { font-size: 30px; }
    .auth-intro { margin-bottom: 28px; }
    .auth-form fieldset { gap: 21px; }
    .auth-help { font-size: 12px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .service, .room-card { transition: none; }
  }

  /* Full-screen anonymous login; authenticated password screens keep their shell. */
  body:has(#login-form) { background: #607af5; }
  body:has(#login-form) .sidebar {
    position: absolute; z-index: 2; inset: 42px auto auto 5.5%;
    width: 190px; height: 52px; padding: 0; border: 0; background: transparent;
    display: block; transform: none; box-shadow: none;
  }
  body:has(#login-form) .sidebar-head { height: 52px; min-height: 0; margin: 0; }
  body:has(#login-form) .sidebar-head .brand {
    width: 190px; height: 52px; min-height: 0; padding: 0;
    visibility: visible; opacity: 1; pointer-events: auto;
  }
  body:has(#login-form) .brand-logo { width: 180px; max-width: 100%; }
  body:has(#login-form) .sidebar nav,
  body:has(#login-form) .sidebar-footer,
  body:has(#login-form) .sidebar-toggle,
  body:has(#login-form) .mobile-sidebar-close,
  body:has(#login-form) .sidebar-backdrop,
  body:has(#login-form) .topbar { display: none !important; }
  body:has(#login-form) .workspace { margin-left: 0; }
  body:has(#login-form) main {
    min-height: max(900px, 100vh); padding: 150px calc(45% + 60px) 50px 60px;
    background: #607af5;
  }
  body:has(#login-form) main::before { display: block; inset: 0 45% 0 0; border-radius: 0 28px 28px 0; }
  body:has(#login-form) main::after { display: block; inset: 27% 2% 7% 57%; background-size: 114% auto; }
  body:has(#login-form) .auth-panel { max-width: 390px; padding: 26px 0 0; }
  body:has(#login-form) .auth-intro { margin-bottom: 38px; }
  body:has(#login-form) main > .footer-note { max-width: 390px; margin-top: 36px; }
  .faithful-auth-art { display: none; }
  body:has(#login-form) .faithful-auth-art {
    display: block; position: absolute; z-index: 1; top: 72px; left: calc(55% + 6.25%);
    width: 32%; color: #fff; pointer-events: none;
  }
  .faithful-auth-art > p:first-child { margin: 0 0 24px; font-size: 11px; letter-spacing: .14em; }
  .faithful-auth-art h2 { color: #fff; margin: 0 0 20px; font-size: 31px; line-height: 1.5; font-weight: 650; }
  .faithful-auth-art > p:last-child { margin: 0; color: #f1f3ff; font-size: 13px; line-height: 1.9; }
  @media (min-width: 761px) and (max-width: 1100px) {
    body:has(#login-form) main { padding: 145px calc(45% + 36px) 45px 36px; }
    body:has(#login-form) .faithful-auth-art { left: 61%; width: 34%; }
    .faithful-auth-art h2 { font-size: 25px; }
    body:has(#login-form) main::after { inset: 33% 0 12% 56%; background-size: 123% auto; }
    body:has(#login-form) .auth-panel h1 { font-size: 30px; }
  }
  @media (max-width: 760px) {
    body:has(#login-form) { background: #fff; }
    body:has(#login-form) .sidebar { top: 25px; left: 26px; width: 180px; }
    body:has(#login-form) main { min-height: 100vh; padding: 118px 26px 40px; background: #fff; }
    body:has(#login-form) main::before,
    body:has(#login-form) main::after,
    body:has(#login-form) .faithful-auth-art { display: none; }
    body:has(#login-form) .auth-panel { padding-top: 18px; }
    body:has(#login-form) .auth-intro { margin-bottom: 30px; }
  }
}

@media print { .faithful-auth-art { display: none !important; } }

/* The release keeps its footer outside main; preserve readable login footer text. */
@media screen {
  body:has(#login-form) .workspace > .footer-note {
    margin: 0; padding: 16px 24px; color: #59657e; background: #fff;
  }
}
