:root { color-scheme: light; --paper: #f7f2e7; --ink: #3e422f; --muted: #68705c; --green: #3b5944; --line: #d6d3bf; --gold: #f4d181; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; line-height: 1.65; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .32; background-image: radial-gradient(#9c9475 0.6px, transparent 0.6px); background-size: 7px 7px; }
button, input, textarea { font: inherit; color: inherit; }
button, .visit { min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 10px 17px; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
button:disabled { cursor: default; opacity: .65; }
button:not(:disabled):hover, .visit:hover { filter: brightness(.95); }
:focus-visible { outline: 3px solid #aa702e; outline-offset: 4px; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
h1 { font-family: 'Batang', 'AppleMyungjo', Georgia, serif; font-size: clamp(38px, 5.5vw, 58px); font-weight: 700; line-height: 1.27; letter-spacing: -.07em; }
h2 { font-size: 22px; letter-spacing: -.05em; }
h3 { font-size: 20px; letter-spacing: -.04em; }
p { overflow-wrap: anywhere; }
.masthead, main, footer { width: min(1040px, calc(100% - 64px)); margin: 0 auto; }
.masthead { min-height: 100px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: Georgia, 'Malgun Gothic', serif; font-size: 23px; font-weight: 700; line-height: 1.3; }
.brand small { display: block; margin-top: 4px; font-family: 'Malgun Gothic', sans-serif; font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 44px; height: 48px; color: var(--gold); background: var(--green); border-radius: 9px 9px 18px 18px; font-size: 34px; }
#account { display: flex; align-items: center; gap: 8px; font-size: 14px; }
#account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiet { padding: 8px 10px; background: transparent; font-size: 13px; font-weight: 500; }
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 346px; padding: 38px 34px 30px; }
.eyebrow { margin-bottom: 13px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--green); }
.welcome-copy > p:last-child { margin-top: 21px; font-size: 15px; color: var(--muted); line-height: 1.8; }
.island-scene { width: 38%; max-width: 360px; flex-shrink: 0; }
.primary { background: var(--green); color: #fff9e9; border-color: var(--green); box-shadow: 0 2px 0 #243b2c; }
.secondary { background: #fffdf6; border-color: #b8bba4; }
.danger { background: #a04532; color: white; }
.notice { padding: 38px; border: 1px solid var(--line); background: #fffdf6; border-radius: 12px; text-align: center; }
.notice button { margin-top: 15px; }
.login-card { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 12px; padding: 34px 40px; background: #fffdf6; }
.login-card > div > p:last-child { margin-top: 15px; font-size: 14px; color: var(--muted); }
form { display: grid; gap: 7px; }
label { font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; min-width: 0; border: 1px solid #b8bba4; border-radius: 7px; background: #fffefa; padding: 11px 12px; font-size: 16px; }
input + label { margin-top: 10px; }
.error { color: #a03a29; font-size: 14px; }
.error:empty { display: none; }
#login-error { margin: 7px 0; }
.directory-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 10px 0 22px; }
#online-count { display: inline-block; margin-left: 8px; padding: 3px 9px; vertical-align: 3px; border: 1px solid #c1cfaf; border-radius: 20px; color: var(--green); background: #e6ecd8; font-size: 12px; font-weight: 700; letter-spacing: 0; }
#directory-updated { margin-top: 7px; color: var(--muted); font-size: 12px; }
#directory-error { margin-bottom: 14px; }
#directory-retry { margin-bottom: 20px; }
.device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.device-card { display: flex; flex-direction: column; min-width: 0; background: #fffdf6; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.device-card.online { border-top: 4px solid #6e8b58; }
.device-card.offline { border-top: 4px solid #b6b5a7; background: #eeede4; }
.device-heading { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 10px; gap: 10px; }
.pc-mark { display: grid; place-items: center; width: 43px; height: 39px; border: 2px solid #7d8b6e; border-bottom-width: 6px; border-radius: 5px; color: #607c54; font-size: 23px; }
.offline .pc-mark { color: #929386; border-color: #aaa99b; }
.status { display: inline-flex; gap: 6px; align-items: center; border-radius: 16px; padding: 3px 8px; background: #e6ecd8; color: #385b36; font-size: 11px; font-weight: 700; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.offline .status { background: #e0e0d5; color: #626457; }
.device-details { padding: 8px 20px 19px; flex: 1; }
.device-details h3 { overflow-wrap: anywhere; }
.hostname { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.last-seen { margin-top: 19px; font-size: 12px; color: var(--muted); }
.device-actions { display: flex; gap: 7px; padding: 14px; border-top: 1px solid var(--line); }
.visit { display: block; flex: 1; color: var(--green); background: #e6ecd8; font-size: 14px; }
.visit:disabled { color: #616459; background: #e1e0d6; }
.disconnect { border: 0; background: transparent; color: var(--muted); padding: 7px; font-size: 12px; font-weight: 500; }
.empty { padding: 35px 20px; background: #fffdf6; border: 1px dashed #b4b99f; border-radius: 12px; text-align: center; }
.empty-mark { font-size: 43px; color: #91a07c; }
.empty p { margin: 12px 0 20px; font-size: 14px; color: var(--muted); }
.directory-note { margin: 19px 0 0; font-size: 12px; color: var(--muted); }
footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 60px; padding: 21px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-family: Georgia, 'Malgun Gothic', serif; font-size: 13px; }
footer span { font-family: 'Malgun Gothic', sans-serif; font-size: 12px; }
dialog { width: min(550px, calc(100% - 32px)); max-height: calc(100dvh - 40px); margin: auto; border: 1px solid #b8bba4; border-radius: 14px; padding: 26px; background: #fffdf6; color: var(--ink); box-shadow: 0 18px 60px #28392440; }
dialog::backdrop { background: #28372880; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 21px; }
.close { background: transparent; font-size: 26px; padding: 0 10px; }
dialog p { font-size: 14px; margin: 12px 0; }
#pair-content { margin-top: 20px; }
#pair-command { margin-top: 8px; resize: vertical; font-family: Consolas, monospace; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.pair-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
#pair-expiry, dialog .small { color: var(--muted); font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width: 760px) {
  .masthead, main, footer { width: calc(100% - 36px); }
  .masthead { min-height: 86px; gap: 10px; }
  .brand { font-size: 19px; gap: 9px; }
  .brand-mark { width: 37px; height: 42px; }
  #account { gap: 1px; }
  #account-name { max-width: 80px; font-size: 12px; }
  .welcome { padding: 28px 10px; min-height: 290px; gap: 0; }
  .welcome-copy { position: relative; z-index: 1; }
  .welcome-copy > p:last-child { font-size: 13px; }
  .island-scene { width: 40%; margin-left: -20px; }
  .device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .login-card { gap: 24px; padding: 26px; grid-template-columns: 1fr; }
  .login-card > div > p:last-child br { display: none; }
  footer { margin-top: 38px; flex-direction: column; gap: 4px; }
}
@media (max-width: 460px) {
  .masthead { flex-wrap: wrap; padding: 17px 0; }
  .welcome { min-height: 268px; padding: 26px 4px; }
  .welcome-copy > p:last-child { font-size: 12px; }
  .island-scene { width: 39%; margin-left: -42px; margin-top: 32px; }
  h1 { font-size: 38px; }
  h2 { font-size: 20px; }
  .directory-heading { align-items: flex-start; }
  .directory-heading .primary { font-size: 13px; padding: 9px 12px; white-space: nowrap; }
  #online-count { display: table; margin: 6px 0 0; }
  .device-grid { grid-template-columns: 1fr; }
  .device-heading { padding: 17px 20px 4px; }
  .device-details { padding-top: 4px; }
  .last-seen { margin-top: 10px; }
  dialog { padding: 21px; }
}
