:root {
  color-scheme: light;
  --bg: #f4f4f0;
  --surface: #ffffff;
  --ink: #151816;
  --muted: #6c716d;
  --line: #dedfd9;
  --orange: #f6821f;
  --orange-deep: #d9680e;
  --navy: #13243a;
  --green: #1d9b6c;
  --shadow: 0 24px 70px rgba(25, 32, 28, .09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .025;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

.topbar {
  height: 76px;
  padding: 0 clamp(24px, 4.5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(22, 24, 22, .08);
  background: rgba(244, 244, 240, .86);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 760;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--orange);
  border-radius: 10px;
  box-shadow: 0 5px 14px rgba(246, 130, 31, .24);
}

.brand-mark svg { width: 25px; fill: white; }
.brand-mark .sun { fill: none; stroke: white; stroke-width: 2; stroke-linecap: round; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #5c625e;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(29,155,108,.12); }

.icon-button, .text-button, .mini-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.text-button { font-size: 13px; font-weight: 650; padding: 10px; color: var(--muted); }
.text-button:hover { color: var(--ink); }

main { width: min(1440px, 100%); margin: 0 auto; }

.connect-view {
  min-height: calc(100vh - 76px);
  padding: clamp(42px, 7vw, 100px) clamp(24px, 7vw, 112px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .72fr);
  align-items: center;
  gap: clamp(55px, 9vw, 150px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 760;
  color: var(--orange-deep);
}

.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--orange); }

.hero-copy h1, .dashboard-head h1 {
  margin: 22px 0 22px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: .98;
  letter-spacing: -.065em;
  font-weight: 760;
}

.hero-copy h1 span { color: var(--orange); }
.hero-copy > p { max-width: 620px; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.78; }

.hero-points {
  margin-top: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.hero-points span { font-size: 13px; font-weight: 650; color: #484d49; }
.hero-points i { font-style: normal; color: var(--orange-deep); margin-right: 8px; font-variant-numeric: tabular-nums; }

.connect-card {
  background: var(--surface);
  border: 1px solid rgba(21, 24, 22, .08);
  border-radius: 24px;
  padding: clamp(26px, 3.5vw, 44px);
  box-shadow: var(--shadow);
}

.step-label { color: var(--orange-deep); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; font-weight: 760; }
.card-heading h2 { font-size: 25px; letter-spacing: -.035em; margin: 10px 0 8px; }
.card-heading p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 30px; }

label { display: block; font-size: 12px; font-weight: 720; margin-bottom: 9px; color: #424743; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.label-row label { margin-bottom: 9px; }
.mini-button { color: var(--orange-deep); font-size: 12px; padding: 0 0 9px; }

input, select {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafaf8;
  padding: 0 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

select { appearance: none; cursor: pointer; padding-right: 42px; background-image: linear-gradient(45deg, transparent 50%, #777d78 50%), linear-gradient(135deg, #777d78 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus { border-color: rgba(246, 130, 31, .75); box-shadow: 0 0 0 4px rgba(246,130,31,.11); background-color: white; }
input::placeholder { color: #a1a5a1; }

.storage-label { margin-top: 20px; }
.storage-hint { margin: 8px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.storage-hint.caution { color: #9a5b18; }

.permission-box {
  display: flex;
  gap: 12px;
  padding: 15px;
  border-radius: 12px;
  margin: 22px 0;
  background: #f5f7f4;
  border: 1px solid #e5e8e2;
}

.permission-box svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.permission-box strong { font-size: 12px; }
.permission-box p { margin: 4px 0 0; font-size: 11px; line-height: 1.55; color: var(--muted); }
.permission-box b { color: #434844; }

.form-error { margin: -8px 0 16px; font-size: 12px; color: #b63737; line-height: 1.5; }

.primary-button {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 11px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: var(--navy);
  color: white;
  font-weight: 680;
  transition: transform .18s, background .18s;
}

.primary-button:hover { background: #1b304c; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .72; transform: none; }
.primary-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.form-links { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 18px; }
.form-links a, .form-links button { font-size: 12px; color: var(--muted); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.form-links a:hover, .form-links button:hover { color: var(--orange-deep); }

.dashboard-view { padding: clamp(38px, 5vw, 76px) clamp(24px, 4.5vw, 76px) 36px; }
.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.dashboard-head h1 { font-size: clamp(38px, 5vw, 66px); margin: 12px 0 10px; }
.account-title-row { display: flex; align-items: center; gap: 14px; }
.account-title-row h1 { min-width: 0; overflow-wrap: anywhere; }
.plan-badge { font-size: 10px; font-weight: 800; letter-spacing: .11em; color: #7c470e; background: #ffead2; padding: 6px 8px; border-radius: 6px; }
.dashboard-head p { margin: 0; font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.period-card { min-width: 260px; border-left: 1px solid var(--line); padding: 4px 0 4px 28px; }
.period-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.period-card strong { display: block; font-size: 30px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.period-card small { color: var(--muted); font-size: 11px; }

.warning-panel { margin-top: 30px; padding: 14px 17px; border: 1px solid #ecd8b5; background: #fff8ea; border-radius: 13px; display: flex; align-items: flex-start; gap: 12px; }
.warning-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: white; background: #d68a1b; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.warning-panel strong { font-size: 12px; }
.warning-panel p { margin: 3px 0 0; font-size: 11px; color: #7c653f; line-height: 1.55; }

.summary-grid { margin: 42px 0 36px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-card { padding: 20px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.55); }
.summary-card span { color: var(--muted); font-size: 11px; font-weight: 650; }
.summary-card strong { font-size: 29px; letter-spacing: -.04em; }
.summary-card strong.time-value { font-size: 20px; }
.summary-card small { color: #8c918d; font-size: 10px; line-height: 1.4; }
.primary-summary { color: white; background: var(--navy); border-color: var(--navy); }
.primary-summary span, .primary-summary small { color: rgba(255,255,255,.65); }

.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.category-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.category-tab { border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 8px 11px; color: var(--muted); font-size: 11px; font-weight: 650; cursor: pointer; }
.category-tab:hover { color: var(--ink); }
.category-tab.active { background: white; border-color: var(--line); color: var(--ink); box-shadow: 0 3px 12px rgba(30,35,31,.04); }
.search-box { margin: 0; width: 210px; height: 38px; position: relative; }
.search-box svg { position: absolute; width: 15px; left: 12px; top: 11px; fill: none; stroke: #8b908c; stroke-width: 1.8; }
.search-box input { height: 38px; padding-left: 35px; font-size: 11px; border-radius: 9px; background: rgba(255,255,255,.62); }

.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.resource-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 19px; background: rgba(255,255,255,.8); transition: transform .18s, box-shadow .18s, border-color .18s; }
.resource-card:hover { transform: translateY(-2px); box-shadow: 0 15px 38px rgba(29,34,30,.07); border-color: #d0d2cc; }
.resource-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #e8e9e5; }
.resource-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.resource-icon { --tone: #68716c; width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tone) 12%, white); color: var(--tone); font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.resource-identity h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.resource-identity p { margin: 4px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-chip { color: #737974; background: #f1f2ef; padding: 5px 7px; border-radius: 6px; font-size: 9px; font-weight: 700; }

.metric-list { padding-top: 16px; display: grid; gap: 16px; }
.metric-head, .metric-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.metric-head span { font-size: 11px; color: #555b56; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-head strong { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-progress { display: block; width: 100%; height: 5px; margin: 8px 0 6px; overflow: hidden; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; color: var(--tone, var(--orange)); background: #e9eae6; }
.metric-progress::-webkit-progress-bar { border-radius: inherit; background: #e9eae6; }
.metric-progress::-webkit-progress-value { border-radius: inherit; background: currentColor; }
.metric-progress::-moz-progress-bar { border-radius: inherit; background: currentColor; }
.metric-foot { color: #959a96; font-size: 9px; line-height: 1.35; }
.metric-foot > span:first-child { min-width: 0; }
.metric-percent { flex: 0 0 auto; color: #686e69; font-variant-numeric: tabular-nums; font-weight: 700; }
.metric-foot .danger { color: #bd3c3c; }
.metric-note { margin-top: 5px; color: #8d928e; font-size: 9px; line-height: 1.35; }

.tone-orange { --tone: #e97318; } .tone-blue { --tone: #367ac8; } .tone-violet { --tone: #7e61bd; }
.tone-purple { --tone: #7952a8; } .tone-slate { --tone: #64717d; } .tone-cyan { --tone: #198a9b; }
.tone-indigo { --tone: #5266c2; } .tone-amber { --tone: #c78720; } .tone-emerald { --tone: #228b68; }
.tone-teal { --tone: #237f79; } .tone-lime { --tone: #668d26; } .tone-pink { --tone: #ba568c; }
.tone-rose { --tone: #bd5368; } .tone-fuchsia { --tone: #a44cad; } .tone-sky { --tone: #3b87a8; }
.tone-red { --tone: #b84d45; } .tone-yellow { --tone: #aa851e; } .tone-green { --tone: #47824e; }

.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 15px; }
.dashboard-footer { display: flex; justify-content: space-between; gap: 20px; color: #929793; font-size: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }

.loading-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; text-align: center; background: rgba(244,244,240,.88); backdrop-filter: blur(10px); }
.loading-overlay strong { font-size: 17px; margin-top: 18px; }
.loading-overlay p { font-size: 12px; color: var(--muted); margin: 7px 0 0; }
.loader-mark { height: 28px; display: flex; justify-content: center; align-items: flex-end; gap: 5px; }
.loader-mark span { width: 8px; border-radius: 4px; background: var(--orange); animation: load .9s infinite ease-in-out; }
.loader-mark span:nth-child(1) { height: 13px; }
.loader-mark span:nth-child(2) { height: 26px; animation-delay: .12s; }
.loader-mark span:nth-child(3) { height: 18px; animation-delay: .24s; }

@keyframes load { 0%,100% { transform: scaleY(.45); opacity: .45; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes shimmer { from { transform: translateX(-160%); } to { transform: translateX(320%); } }

@media (max-width: 1050px) {
  .connect-view { grid-template-columns: 1fr 390px; gap: 50px; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .topbar { height: 66px; }
  .privacy-pill { display: none; }
  .connect-view { min-height: auto; grid-template-columns: 1fr; padding-top: 55px; gap: 52px; }
  .hero-copy h1 { font-size: clamp(49px, 15vw, 76px); }
  .connect-card { max-width: 560px; width: 100%; }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
  .period-card { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; width: 100%; }
  .controls-row { align-items: flex-start; flex-direction: column-reverse; }
  .search-box { width: 100%; }
}

@media (max-width: 590px) {
  .topbar { padding: 0 18px; }
  .brand { font-size: 14px; }
  .dashboard-view { padding-left: 16px; padding-right: 16px; }
  .resource-grid, .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 116px; }
  .account-title-row { align-items: flex-start; flex-direction: column; gap: 0; }
  .account-title-row h1 { font-size: 42px; }
  .hero-points { display: grid; }
  .dashboard-footer { flex-direction: column; }
}

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