:root {
  color-scheme: light;
  --ink: #172741;
  --muted: #53647d;
  --border: #dbe3ee;
  --paper: #fff;
  --canvas: #f5f7fb;
  --blue: #1456d9;
  --navy: #101d34;
  --focus: #0075e8;
  font-family: system-ui, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 100%;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: #184fc1; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .57; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p, ul, ol { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.065em; margin-bottom: 1rem; }
h2 { font-size: 1.35rem; letter-spacing: -.035em; margin-bottom: .85rem; }
h3 { font-size: 1.05rem; letter-spacing: -.025em; margin-bottom: .55rem; }
p { margin-bottom: 1rem; overflow-wrap: anywhere; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; inset: 1rem auto auto 1rem; padding: .7rem 1rem; border-radius: .6rem; background: white; z-index: 10; }
.layout { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy); padding: 1.8rem 1rem; color: #eff5ff; min-width: 0; }
.sidebar a { color: inherit; text-decoration: none; }
.sidebar a:focus-visible { outline-color: #9cc6ff; }
.brand { display: flex; align-items: center; gap: .8rem; padding: 0 .5rem 1.65rem; font-size: 1.27rem; font-weight: 800; line-height: 1.25; letter-spacing: -.045em; }
.brand small { display: block; font-size: .75rem; font-weight: 500; color: #b9c7dc; margin-top: .32rem; letter-spacing: -.02em; }
.brand-mark { width: 2.35rem; height: 2.35rem; border-radius: .7rem; padding: .56rem; background: #2867f2; display: grid; flex: none; grid-template-columns: 1fr 1fr; gap: 3px; }
.brand-mark i { background: white; border-radius: 2px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { opacity: .7; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav li + li { margin-top: .15rem; }
.sidebar nav a { display: flex; align-items: center; gap: .62rem; min-height: 2.5rem; padding: .46rem .65rem; border-radius: .53rem; color: #dce6f7; font-size: .87rem; font-weight: 580; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { color: #fff; background: #243b65; }
.sidebar nav a[aria-current] { box-shadow: inset 3px 0 #80b1ff; }
.nav-icon { display: inline-grid; place-items: center; width: 1.55rem; min-width: 1.55rem; height: 1.55rem; border-radius: .35rem; background: #ffffff14; color: #a8c8ff; font: 650 .77rem/1 system-ui, sans-serif; }
.nav-group { margin-top: 1.55rem; }
.nav-group h2 { margin: 0 .7rem .45rem; color: #a5b6d0; font-size: .75rem; letter-spacing: .015em; font-weight: 650; }
.surface { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; }
.topbar { min-height: 4.1rem; border-bottom: 1px solid var(--border); background: var(--paper); padding: .65rem clamp(1rem, 3.7vw, 3rem); display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.location { color: var(--muted); margin: 0; font-size: .9rem; font-weight: 650; }
.privacy-link { background: #edf5ff; color: #204e91; padding: .38rem .68rem; border-radius: .55rem; font-size: .83rem; font-weight: 650; text-decoration: none; }
.privacy-link:hover { text-decoration: underline; }
.privacy-link span { color: #2366bd; margin-right: .2rem; }
.mobile-brand, .menu-toggle { display: none; }
#main { width: 100%; max-width: 92rem; margin-inline: auto; padding: clamp(1.15rem, 3.4vw, 2.85rem); }
#main:focus { outline: none; }
footer { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .7rem 1.5rem; padding: 1.2rem clamp(1.15rem, 3.4vw, 2.85rem); border-top: 1px solid var(--border); background: #fff; font-size: .83rem; }
.footer-brand { font-weight: 750; }
footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(13rem, .9fr); min-height: 21rem; align-items: center; overflow: hidden; border: 1px solid #cfdff8; border-radius: 1.25rem; background: linear-gradient(120deg, #f6faff 4%, #e8f2ff 57%, #d6e8ff); padding: clamp(1.5rem, 4.4vw, 4rem); gap: 1.5rem; }
.hero h1 { color: #112644; margin-bottom: .9rem; }
.hero p { color: #3d5677; margin-bottom: 1.5rem; font-size: 1.04rem; }
.hero-visual { position: relative; isolation: isolate; display: grid; place-items: center; min-width: 0; padding: .6rem; }
.hero-visual::before { content: ''; position: absolute; z-index: -1; inset: -2.4rem -5rem -3.1rem -2rem; background-image: radial-gradient(#538ad960 1px, transparent 1px); background-size: 13px 13px; mask-image: radial-gradient(ellipse, black, transparent 73%); }
.sheet-art { width: min(100%, 21rem); min-width: 11.7rem; overflow: hidden; border: 1px solid #afc7e7; border-radius: .85rem; background: #fff; color: #304664; box-shadow: 0 16px 42px #2158ae30; font-size: .81rem; transform: rotate(-5deg); }
.sheet-bar { padding: .63rem .82rem; align-items: center; background: #193b76; color: white; display: flex; gap: .27rem; white-space: nowrap; }
.sheet-bar span { width: .32rem; height: .32rem; border-radius: 50%; background: #b3d1ff; }
.sheet-bar strong { margin-left: .4rem; font-weight: 650; }
.sheet-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr; }
.sheet-row span { padding: .37rem .66rem; border-top: 1px solid #e4ebf5; border-right: 1px solid #e4ebf5; }
.sheet-row span:last-child { border-right: 0; }
.sheet-heading { background: #f0f5fd; color: #244678; font-weight: 700; }
.sheet-row .gain { background: #d7f8eb; color: #02604d; font-weight: 750; }
.sheet-row .loss { background: #ffe5e6; color: #8c3341; font-weight: 700; }
.art-caption { position: absolute; right: -.5rem; bottom: -.8rem; background: #fff; color: #234779; box-shadow: 0 7px 25px #214c9236; padding: .53rem .75rem; border: 1px solid #c8dcf8; border-radius: .56rem; font-size: .78rem; font-weight: 750; }
.art-caption span { color: var(--blue); margin-right: .25rem; }

.tool-directory { margin-block: 2.6rem .5rem; scroll-margin-top: 1.25rem; }
.split-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem 1.2rem; margin-bottom: 1rem; }
.split-head h2 { margin: 0; }
.tool-directory > .split-head h2 { font-size: 1.75rem; }
.search { display: flex; align-items: center; gap: .5rem; border: 1px solid #c8d4e5; border-radius: .65rem; background: white; padding: 0 .7rem; width: min(100%, 18rem); color: #355683; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.search > span:first-child { font-size: 1.3rem; line-height: 1; }
.search input { min-width: 0; width: 100%; padding: .58rem 0; border: 0; outline: none; background: white; font-size: .9rem; }
.filters, .tab-list { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.15rem; }
.filters button, .tab-button { border: 1px solid #cbd7e7; border-radius: 2rem; background: white; padding: .42rem .85rem; min-height: 2.35rem; color: #354b6c; font-size: .87rem; font-weight: 650; }
.filters button:hover, .tab-button:hover { border-color: #6383ba; }
.filters button[aria-pressed="true"], .tab-button[aria-pressed="true"] { background: #e6efff; color: #174bab; border-color: #9cb9f3; }
.card-group { margin-top: 1.9rem; }
.group-heading { margin-bottom: .85rem; }
.group-heading h2 { margin-bottom: .27rem; font-size: 1.17rem; }
.group-heading p { margin: 0; font-size: .91rem; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.card-group:has([data-category="excel"]) .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; min-width: 0; min-height: 9.3rem; padding: 1.05rem; background: white; border: 1px solid var(--border); border-radius: .85rem; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tool-card:hover { border-color: #90aee5; box-shadow: 0 6px 18px #284e8314; }
.tool-card h3 { margin-bottom: .34rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.62; }
.tool-icon { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: 0 0 auto; border-radius: .68rem; font-size: .88rem; font-weight: 800; }
.tool-icon.blue { color: #164cae; background: #e8f0ff; }
.tool-icon.teal { color: #086554; background: #def5eb; }
.tool-icon.violet { color: #64369a; background: #f0e8ff; }
.empty { padding: 1.2rem; background: white; border: 1px dashed #bed0e9; border-radius: .8rem; color: var(--muted); }

.reading { max-width: 54rem; margin-inline: auto; }
.page-intro { margin-bottom: 1.65rem; }
.page-intro h1 { margin-bottom: .6rem; }
.page-intro p { margin-bottom: 0; max-width: 44rem; color: var(--muted); font-size: 1.05rem; }
.guide-hero { padding: 1.8rem; background: linear-gradient(112deg, white, #edf4ff); border: 1px solid #cdddf6; border-radius: 1.05rem; }
.guide-hero > .tool-icon { margin-bottom: .85rem; }
.article, .panel { margin-top: 1rem; padding: clamp(1rem, 3.2vw, 1.65rem); background: white; border: 1px solid var(--border); border-radius: .9rem; min-width: 0; }
.article p:last-child, .article ul:last-child, .article ol:last-child { margin-bottom: 0; }
.steps { padding-left: 1.45rem; }
.steps li { padding-left: .35rem; padding-bottom: .55rem; }
.steps li:last-child { padding-bottom: 0; }
.steps li::marker { color: var(--blue); font-weight: 750; }
.questions details { padding: .8rem 0; border-top: 1px solid var(--border); }
.questions details p { margin: .65rem 0 0; color: #465b77; }
.questions summary { cursor: pointer; font-weight: 650; }
.related { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; }
.related a { display: inline-block; text-decoration: none; border-radius: .5rem; background: #eef4ff; padding: .38rem .7rem; }
.related a:hover { text-decoration: underline; }
.breadcrumbs { font-size: .9rem; margin-bottom: .65rem; }
.work-area { max-width: 74rem; margin-inline: auto; }
.ad-space { margin-top: 1.25rem; padding: .6rem; border: 1px solid var(--border); border-radius: .65rem; text-align: center; background: white; color: #576780; font-size: .8rem; min-height: 9.5rem; }
.ad-sidebar { color: #d9e6fa; border-color: #3d5176; background: #192947; min-height: 17.5rem; }
.adsbygoogle { display: block; width: 100%; min-height: 7.5rem; }
.ad-sidebar .adsbygoogle { min-height: 15.5rem; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .5rem .95rem; border: 1px solid transparent; border-radius: .61rem; text-decoration: none; font-size: .94rem; font-weight: 690; line-height: 1.35; }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:not(:disabled):hover { background: #1248b7; }
.button.subtle { background: white; color: #264a7f; border-color: #bdcde4; }
.button.subtle:not(:disabled):hover { background: #eef5ff; }
.upload-grid, .control-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .75rem; }
.upload-grid { margin-bottom: 1rem; }
.drop { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .2rem; min-height: 9.25rem; padding: .85rem; background: #f7faff; border: 1px dashed #8caee0; border-radius: .76rem; text-align: center; cursor: pointer; }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop:hover, .drop.over { background: #eaf2ff; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-bottom: .15rem; border-radius: .52rem; color: #194ca9; background: #e5efff; font-weight: 700; }
.drop-hint, .drop small, .muted, .status { color: var(--muted); font-size: .9rem; }
.drop small { font-size: .8rem; }
.file-list { margin: .45rem 0 0; padding: 0 0 0 1.15rem; font-size: .9rem; overflow-wrap: anywhere; }
.field { display: grid; gap: .34rem; margin: 0 0 .8rem; min-width: 0; font-size: .94rem; }
.field > span { font-weight: 650; }
.field small { color: var(--muted); font-size: .83rem; }
.field input:not([type="checkbox"]), select, textarea { min-width: 0; max-width: 100%; width: 100%; padding: .5rem .65rem; border: 1px solid #acbfd9; border-radius: .5rem; background: #fff; color: var(--ink); }
select { appearance: none; padding-right: 1.65rem; background-image: linear-gradient(45deg, transparent 49%, #466080 50%), linear-gradient(135deg, #466080 50%, transparent 51%); background-position: calc(100% - 13px) 51%, calc(100% - 8px) 51%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
.check-group { display: flex; flex-wrap: wrap; gap: .3rem 1rem; min-inline-size: 0; margin: 0 0 .85rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: .6rem; }
.check-group legend { padding: 0 .3rem; font-weight: 650; }
.check { display: flex; align-items: center; gap: .35rem; min-height: 2rem; font-size: .92rem; overflow-wrap: anywhere; }
.check input { width: 1rem; height: 1rem; margin: 0 .2rem 0 0; accent-color: var(--blue); flex: none; }
.panel > .actions { margin-top: .8rem; }
.status, .error { margin: .55rem 0 0; }
.status:empty, .error:empty { display: none; }
.error, .warning { color: #8c3030; background: #fff0ee; border: 1px solid #eac2bd; border-radius: .55rem; padding: .55rem .72rem; }
.warning { color: #704500; background: #fff8e6; border-color: #ecd7a6; }
progress { width: 100%; display: block; height: .7rem; margin-top: .9rem; accent-color: var(--blue); }
.stats { display: flex; flex-wrap: wrap; gap: .65rem; margin: .85rem 0 1rem; }
.stats > div { min-width: 6rem; padding: .48rem .8rem; border-radius: .62rem; background: #eff5ff; }
.stats dt { color: #45618a; font-size: .85rem; }
.stats dd { margin: 0; font-size: 1.28rem; font-weight: 750; }
.table-scroll { max-height: 27rem; overflow: auto; border: 1px solid var(--border); border-radius: .65rem; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: .9rem; }
td, th { padding: .55rem .7rem; min-width: 5rem; max-width: 24rem; white-space: pre-wrap; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); }
th { color: #2a446a; background: #f0f5fd; }
thead th { position: sticky; top: 0; z-index: 1; }
td.changed { background: #fff2c2; color: #523700; font-weight: 650; }
.option-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: .6rem; align-items: start; border-top: 1px solid var(--border); padding-top: .65rem; }
.option-row > strong { min-width: 0; overflow-wrap: anywhere; font-size: .93rem; padding: .2rem 0; }

@media (max-width: 1100px) {
  .card-group:has([data-category="excel"]) .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-break { display: none; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 12.5rem minmax(0, 1fr); }
  .sidebar { padding-inline: .65rem; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(10rem, .75fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .layout { display: flex; flex-direction: column; }
  .surface { order: -1; display: contents; }
  .topbar { order: -2; min-height: 3.45rem; gap: .55rem; }
  .mobile-brand { display: inline; color: var(--ink); font-weight: 800; text-decoration: none; font-size: 1.14rem; }
  .menu-toggle:not([hidden]) { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.4rem; background: white; color: #284876; border: 1px solid var(--border); border-radius: .55rem; padding: .32rem .56rem; }
  .location, .ad-sidebar { display: none; }
  .sidebar { order: -1; padding: .7rem 1rem 1.15rem; }
  .js body:not(.menu-open) .sidebar { display: none; }
  .sidebar .brand { display: none; }
  .sidebar nav { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
  .nav-group { margin-top: 0; }
  #main { flex: 1; }
  .hero { min-height: auto; }
  .ad-home, .ad-guide { min-height: 8rem; }
}

@media (max-width: 510px) {
  .hero { grid-template-columns: 1fr; gap: .8rem; padding: 1.3rem; }
  .hero-visual { display: none; }
  .hero h1 { font-size: 2.05rem; }
  .hero p { font-size: .94rem; }
  .topbar { flex-wrap: wrap; }
  .privacy-link { font-size: .75rem; padding: .27rem .39rem; }
  .card-group:has([data-category="excel"]) .cards, .cards { grid-template-columns: 1fr; }
  .tool-card { flex-direction: row; min-height: auto; }
  .search { width: 100%; }
  .tool-directory { margin-top: 1.6rem; }
  .guide-hero { padding: 1.1rem; }
  .option-row { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card { transition: none; }
}
