@layer base,layout,components,utilities;
@layer base {
  :root {
    --bg: #faf9fc;
    --surface: #fff;
    --ink: #24202e;
    --muted: #756f80;
    --line: #eae6ef;
    --purple: #7553ce;
    --purple-hover: #6342bb;
    --soft: #f0ebfa;
    --green: #28785c;
    --green-soft: #edf7f0;
    --red: #b33c50;
    --shadow: 0 12px 45px #3525480a;
    --radius: 18px;
    color-scheme: light;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    color: var(--ink);
    background: var(--bg);
  }
  :root[data-theme="dark"] {
    --bg: #17151d;
    --surface: #211e29;
    --ink: #f4f0fc;
    --muted: #aaa1b9;
    --line: #39333f;
    --purple: #b49aef;
    --purple-hover: #c4adf9;
    --soft: #30263f;
    --green: #8ad5b1;
    --green-soft: #20372d;
    color-scheme: dark;
  }
  * {
    box-sizing: border-box;
  }
  body {
    margin: 0;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
  }
  button,
  a,
  input,
  textarea,
  select {
    -webkit-tap-highlight-color: transparent;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  button {
    cursor: pointer;
  }
  button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
  }
  button,
  a,
  input,
  textarea,
  select {
    outline-offset: 4px;
  }
  :focus-visible {
    outline: 3px solid #a184eb;
  }
  img {
    display: block;
    max-width: 100%;
  }
  svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }
  h1 {
    font-size: clamp(2.4rem, 4.7vw, 4.55rem);
    line-height: 1.08;
    letter-spacing: -0.055em;
    font-weight: 750;
  }
  h2 {
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    letter-spacing: -0.04em;
  }
  h3 {
    font-size: 1.04rem;
    line-height: 1.45;
  }
  p {
    line-height: 1.7;
  }
  small {
    font-size: 0.82rem;
  }
  input,
  textarea,
  select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 10px;
    min-height: 46px;
  }
  textarea {
    resize: vertical;
    min-height: 180px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.65;
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--purple);
  }
  label {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 550;
  }
  fieldset {
    border: 0;
    padding: 0;
    margin: 0;
  }
  details {
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }
  summary {
    cursor: pointer;
    font-weight: 600;
    line-height: 1.6;
  }
  details p,
  details div {
    padding-top: 12px;
    color: var(--muted);
  }
  code,
  pre {
    font-family: ui-monospace, Consolas, monospace;
  }
  pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--bg);
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.65;
    max-height: 520px;
    overflow: auto;
  }
  table {
    width: 100%;
    border-collapse: collapse;
  }
  th,
  td {
    text-align: left;
    padding: 15px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
    vertical-align: top;
  }
  th {
    color: var(--muted);
    font-weight: 500;
  }
  hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 24px 0;
  }
  .skip {
    position: fixed;
    left: 16px;
    top: -100px;
    z-index: 20;
    background: var(--surface);
    padding: 12px;
  }
  .skip:focus {
    top: 12px;
  }
}
@layer layout {
  .wrap {
    max-width: 1240px;
    padding: 0 36px;
    margin: auto;
  }
  .header {
    height: 88px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: relative;
    z-index: 5;
  }
  .header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 30px;
  }
  .brand {
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
  }
  .brand-mark {
    width: 37px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 12px 12px 12px 4px;
    background: var(--purple);
    color: #fff;
    font-size: 24px;
    font-weight: 750;
    box-shadow: 4px 4px 0 #d7c9f3;
  }
  .brand-name {
    font-weight: 750;
    font-size: 1.35rem;
    letter-spacing: -0.05em;
  }
  .brand-name small {
    display: block;
    font-size: 0.63rem;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-top: 2px;
  }
  .nav {
    display: flex;
    gap: 26px;
    margin: auto;
  }
  .nav a {
    font-size: 0.88rem;
    color: var(--muted);
    padding: 12px 0;
    white-space: nowrap;
  }
  .nav a.active,
  .nav a:hover {
    color: var(--purple);
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .header-actions .button {
    min-height: 40px;
    padding: 9px 15px;
    font-size: 0.85rem;
  }
  .hero {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 558px;
    align-items: center;
    padding-top: 32px;
    padding-bottom: 44px;
    gap: 24px;
  }
  .hero-copy {
    padding: 18px 0;
  }
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--purple);
    font-size: 0.83rem;
    font-weight: 600;
    margin-bottom: 24px;
  }
  .eyebrow:before {
    content: "";
    width: 20px;
    height: 1px;
    background: currentColor;
  }
  .hero h1 em {
    font-style: normal;
    color: var(--purple);
  }
  .hero-copy > p {
    color: var(--muted);
    font-size: 1.08rem;
    max-width: 390px;
    margin: 24px 0 28px;
  }
  .hero-proof {
    display: flex;
    gap: 22px;
    margin-top: 27px;
    font-size: 0.8rem;
    color: var(--muted);
  }
  .hero-proof span {
    display: flex;
    gap: 7px;
    align-items: center;
  }
  .hero-proof svg {
    width: 15px;
    height: 15px;
    color: var(--green);
  }
  .hero-art {
    height: 476px;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .hero-art:before {
    content: "";
    position: absolute;
    inset: 58px 2px 0 35px;
    background: #eae4f7;
    border-radius: 48% 48% 28px 28px;
    z-index: -2;
    transform: rotate(-3deg);
  }
  .hero-art:after {
    content: "";
    position: absolute;
    inset: auto 40px -12px 70px;
    height: 50px;
    background: #55378a20;
    filter: blur(22px);
    border-radius: 50%;
    z-index: -1;
  }
  .hero-art img {
    width: 440px;
    height: 480px;
    object-fit: contain;
    object-position: bottom;
    filter: drop-shadow(0 12px 8px #48306b18);
  }
  .hero-label {
    position: absolute;
    right: 0;
    bottom: 27px;
    background: var(--surface);
    padding: 13px 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .hero-label > span:first-child {
    color: var(--purple);
    background: var(--soft);
    padding: 9px;
    border-radius: 10px;
  }
  .hero-label strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 3px;
  }
  .hero-label small {
    color: var(--muted);
  }
  .section {
    padding: 35px 0 48px;
  }
  .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 25px;
  }
  .section-head p {
    color: var(--muted);
    margin-top: 6px;
    font-size: 0.94rem;
  }
  .toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  .toolbar .search-field {
    margin-left: auto;
    min-width: 230px;
  }
  .search-field {
    position: relative;
    display: flex;
    align-items: center;
  }
  .search-field svg {
    position: absolute;
    left: 13px;
    color: var(--muted);
    width: 17px;
  }
  .search-field input {
    padding-left: 40px;
    background: var(--surface);
  }
  .product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
  .product-grid.list {
    grid-template-columns: 1fr;
  }
  .product-grid.list .product-card {
    display: grid;
    grid-template-columns: 50px 1fr 120px 120px;
    gap: 18px;
    align-items: center;
  }
  .product-grid.list .product-card .product-top {
    margin: 0;
  }
  .product-grid.list .product-card .product-bottom {
    margin: 0;
    display: contents;
  }
  .product-grid.list .product-card .stock {
    display: none;
  }
  .tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
  .page-head {
    padding: 46px 0 28px;
  }
  .page-head h1 {
    font-size: 2.5rem;
    letter-spacing: -0.045em;
  }
  .page-head p {
    margin-top: 12px;
    color: var(--muted);
    max-width: 650px;
  }
  .workspace {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 36px;
    padding-bottom: 64px;
  }
  .workspace-nav {
    align-self: start;
    position: sticky;
    top: 24px;
    display: grid;
    gap: 4px;
  }
  .workspace-nav a {
    padding: 11px 14px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 0.87rem;
  }
  .workspace-nav a.active {
    background: var(--soft);
    color: var(--purple);
    font-weight: 600;
  }
  .two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .checkout {
    display: grid;
    grid-template-columns: 1fr 410px;
    gap: 40px;
    padding-bottom: 70px;
  }
  .checkout .panel {
    align-self: start;
  }
  .account-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
  }
  .auth-box {
    max-width: 440px;
    margin: 24px auto 60px;
  }
  .article {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 64px;
  }
  .article h2 {
    font-size: 1.35rem;
    margin: 30px 0 10px;
  }
  .article p,
  .article li {
    color: var(--muted);
    line-height: 1.85;
  }
  .article a {
    color: var(--purple);
    text-decoration: underline;
  }
  .article img {
    border-radius: 14px;
  }
  .footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    padding: 38px 0;
    color: var(--muted);
  }
  .footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: center;
  }
  .footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
  }
  .footer .brand-name {
    color: var(--ink);
  }
  .preview-note {
    background: #fff6d9;
    color: #795c15;
    font-size: 0.8rem;
    text-align: center;
    padding: 7px;
  }
  .preview-note + .header {
    height: 82px;
  }
  .table-wrap {
    overflow: auto;
  }
  @media (max-width: 1050px) {
    .wrap {
      padding: 0 24px;
    }
    .nav {
      gap: 17px;
    }
    .header-inner {
      gap: 20px;
    }
    .header-actions .theme-btn {
      display: none;
    }
    .product-grid {
      grid-template-columns: repeat(3, 1fr);
    }
    .hero {
      min-height: 500px;
    }
    .hero-art {
      height: 430px;
    }
    .hero-art img {
      height: 445px;
    }
    .workspace {
      grid-template-columns: 180px minmax(0, 1fr);
      gap: 24px;
    }
    .checkout {
      grid-template-columns: 1fr 360px;
    }
  }
  @media (max-width: 760px) {
    .wrap {
      padding: 0 18px;
    }
    .header {
      height: auto !important;
    }
    .header-inner {
      height: 76px;
      flex-wrap: wrap;
      gap: 10px;
    }
    .brand-name {
      font-size: 1.22rem;
    }
    .nav {
      order: 3;
      width: 100%;
      overflow-x: auto;
      justify-content: flex-start;
      gap: 25px;
      height: 44px;
      align-items: start;
      margin: 0;
    }
    .header-inner {
      height: 120px;
      padding-bottom: 0;
    }
    .header-actions {
      margin-left: auto;
    }
    .header-actions .button {
      font-size: 0;
      width: 40px;
      padding: 10px;
    }
    .hero {
      grid-template-columns: 1fr;
      gap: 0;
      padding-top: 36px;
      padding-bottom: 20px;
    }
    .hero-copy {
      padding: 0;
    }
    .hero h1 {
      font-size: 3.35rem;
      max-width: 420px;
    }
    .hero-copy > p {
      font-size: 1rem;
      margin: 19px 0 23px;
      max-width: 350px;
    }
    .eyebrow {
      margin-bottom: 20px;
    }
    .hero-art {
      height: 350px;
      margin: 22px 6px 12px;
    }
    .hero-art:before {
      inset: 30px 15px 0 15px;
    }
    .hero-art img {
      height: 365px;
      width: 360px;
    }
    .hero-label {
      right: 0;
      bottom: 14px;
    }
    .hero-proof {
      gap: 17px;
      margin-top: 22px;
    }
    .section {
      padding: 25px 0;
    }
    .product-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .tool-grid {
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    .section-head {
      align-items: start;
    }
    .section-head p {
      font-size: 0.86rem;
    }
    .toolbar {
      gap: 8px;
    }
    .toolbar .search-field {
      order: -1;
      width: 100%;
      margin: 0;
    }
    .toolbar select {
      width: auto;
      flex: 1;
      min-width: 130px;
    }
    .workspace,
    .account-layout {
      display: block;
    }
    .workspace-nav {
      position: static;
      display: flex;
      overflow-x: auto;
      white-space: nowrap;
      margin-bottom: 20px;
      padding-bottom: 5px;
    }
    .workspace-nav a {
      padding: 10px 12px;
    }
    .two-col,
    .checkout {
      grid-template-columns: 1fr;
      gap: 20px;
    }
    .checkout {
      padding-bottom: 40px;
    }
    .page-head {
      padding: 32px 0 24px;
    }
    .page-head h1 {
      font-size: 2rem;
    }
    .footer-inner {
      align-items: start;
      flex-direction: column;
    }
    .footer-links {
      gap: 15px;
    }
    .product-grid.list .product-card {
      grid-template-columns: 40px 1fr;
    }
    .product-grid.list .product-card .product-bottom {
      display: flex;
      grid-column: 2;
      align-items: center;
    }
    .product-grid.list .product-card .compare {
      display: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
}
@layer components {
  /* Keep the theme switch within reach when the phone header has room. */
  @media (min-width: 361px) and (max-width: 760px) {
    .header-actions .theme-btn {
      display: inline-grid;
    }
  }
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    background: var(--purple);
    color: white;
    transition:
      background 0.15s,
      transform 0.15s;
    white-space: nowrap;
  }
  .button:hover {
    background: var(--purple-hover);
  }
  .button.secondary {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
  }
  .button.secondary:hover {
    border-color: #c7b8e6;
    background: var(--soft);
  }
  .button.ghost {
    color: var(--purple);
    background: transparent;
    padding-left: 4px;
    padding-right: 4px;
  }
  .button.small {
    min-height: 37px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .button.danger {
    background: #fae9ed;
    color: var(--red);
  }
  .icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--muted);
  }
  .icon-button:hover {
    color: var(--purple);
    background: var(--soft);
  }
  .actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    border-radius: 8px;
    padding: 8px 13px;
    min-height: 36px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .chip.active {
    color: var(--purple);
    border-color: #cbbce9;
    background: var(--soft);
    font-weight: 600;
  }
  .chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 10px;
  }
  .product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition:
      box-shadow 0.18s,
      border-color 0.18s;
  }
  .product-card:hover {
    border-color: #cec1e5;
    box-shadow: var(--shadow);
  }
  .product-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }
  .product-logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--soft);
    font-weight: 700;
    color: var(--purple);
    font-size: 1.2rem;
  }
  .product-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
  }
  .compare {
    border: 0;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    background: var(--bg);
    font-size: 20px;
    color: var(--muted);
  }
  .product-name {
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    border: 0;
    padding: 0;
    background: none;
    color: var(--ink);
    min-height: 45px;
    cursor: pointer;
  }
  .product-desc {
    font-size: 0.79rem;
    color: var(--muted);
    margin-top: 7px;
    line-height: 1.6;
  }
  .stock {
    font-size: 0.76rem;
    color: var(--green);
    margin-top: 14px;
  }
  .stock.out {
    color: var(--muted);
  }
  .product-bottom {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
  }
  .price {
    font-size: 1.03rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
  }
  .price small {
    font-size: 0.76rem;
    font-weight: 400;
    color: var(--muted);
  }
  .tool-card {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 14px;
    padding: 23px;
    display: block;
  }
  .tool-card:hover {
    border-color: #c5b4e6;
    box-shadow: var(--shadow);
  }
  .tool-card .tool-icon {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    background: var(--soft);
    color: var(--purple);
    border-radius: 10px;
    margin-bottom: 17px;
  }
  .tool-card p {
    font-size: 0.87rem;
    color: var(--muted);
    margin-top: 8px;
  }
  .tool-card small {
    display: block;
    color: var(--purple);
    font-size: 0.75rem;
    margin-bottom: 8px;
  }
  .panel {
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .panel h2 {
    font-size: 1.23rem;
    margin-bottom: 16px;
  }
  .panel p.muted {
    margin: 10px 0 18px;
  }
  .panel form,
  .form-stack {
    display: grid;
    gap: 18px;
  }
  .panel + .panel {
    margin-top: 20px;
  }
  .result {
    min-height: 200px;
    background: var(--bg);
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font:
      0.9rem/1.7 ui-monospace,
      Consolas,
      monospace;
    max-height: 600px;
    overflow: auto;
  }
  .result:empty:before {
    content: "Kết quả sẽ hiện ở đây.";
    color: var(--muted);
  }
  .notice {
    padding: 14px 17px;
    border-radius: 10px;
    background: var(--soft);
    color: var(--purple);
    font-size: 0.87rem;
    line-height: 1.65;
    margin: 14px 0;
  }
  .notice.warning {
    background: #fff5d7;
    color: #785d17;
  }
  .notice.error {
    background: #fbeaf0;
    color: #a13650;
  }
  .empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
  }
  .empty h2 {
    color: var(--ink);
    margin: 15px 0 10px;
  }
  .empty .button {
    margin-top: 20px;
  }
  .badge {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    padding: 4px 8px;
    background: var(--soft);
    color: var(--purple);
    font-size: 0.75rem;
    font-weight: 500;
  }
  .badge.success {
    color: var(--green);
    background: var(--green-soft);
  }
  .badge.muted {
    color: var(--muted);
    background: var(--bg);
  }
  .tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--soft);
    border-radius: 11px;
    max-width: max-content;
    margin-bottom: 22px;
    overflow: auto;
  }
  .tabs button {
    border: 0;
    border-radius: 8px;
    background: transparent;
    padding: 10px 16px;
    color: var(--muted);
    white-space: nowrap;
    font-size: 0.88rem;
  }
  .tabs button.active {
    background: var(--surface);
    color: var(--purple);
    box-shadow: 0 2px 7px #33205009;
  }
  .check-row {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 400;
    font-size: 0.95rem;
  }
  .check-row input {
    margin: 3px 0;
  }
  .check-row a {
    font-size: 0.85rem;
    color: var(--purple);
    display: block;
    margin-top: 6px;
  }
  .stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 22px 0;
  }
  .stat {
    padding: 23px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .stat strong {
    font-size: 1.8rem;
    display: block;
    margin-top: 10px;
    letter-spacing: -0.04em;
  }
  .stat span {
    font-size: 0.85rem;
    color: var(--muted);
  }
  .step-strip {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
  }
  .step-strip span {
    border-bottom: 2px solid var(--line);
    padding-bottom: 10px;
    flex: 1;
  }
  .step-strip .active {
    color: var(--purple);
    border-color: var(--purple);
  }
  .summary-line {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
  }
  .summary-line span:first-child {
    color: var(--muted);
  }
  .qr {
    width: 230px;
    height: 230px;
    object-fit: contain;
    margin: 20px auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
  }
  .otp-code {
    font-variant-numeric: tabular-nums;
    font-size: 2rem;
    letter-spacing: 0.16em;
    font-weight: 700;
    color: var(--purple);
  }
  .otp-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .comparison-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--surface);
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 8px 35px #0002;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
    font-size: 0.85rem;
  }
  .comparison-bar .button {
    min-height: 38px;
    padding: 8px 14px;
  }
  .search-results {
    display: grid;
    gap: 6px;
    max-height: 60vh;
    overflow: auto;
  }
  .search-result {
    padding: 13px 15px;
    border: 0;
    border-radius: 9px;
    background: var(--bg);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--ink);
  }
  .search-result:hover,
  .search-result:focus {
    background: var(--soft);
    color: var(--purple);
  }
  .search-result small {
    color: var(--muted);
  }
  dialog {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 34px;
    width: min(760px, calc(100% - 28px));
    max-height: 88dvh;
    box-shadow: 0 30px 110px #23133625;
  }
  dialog::backdrop {
    background: #1e17295c;
    backdrop-filter: blur(3px);
  }
  .modal-close {
    position: absolute;
    right: 13px;
    top: 13px;
    font-size: 25px;
    width: 34px;
    height: 34px;
  }
  dialog h2 {
    font-size: 1.6rem;
    padding-right: 25px;
    margin-bottom: 18px;
  }
  #toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    max-width: min(400px, calc(100% - 44px));
    padding: 14px 18px;
    color: #fff;
    background: #30283c;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 30;
    display: none;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  #toast.visible {
    display: block;
  }
  .loading {
    padding: 100px;
    text-align: center;
    color: var(--muted);
  }
  .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--line);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  .howto {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
  }
  .howto p {
    color: var(--muted);
    font-size: 0.87rem;
    margin-top: 7px;
  }
  .howto svg {
    color: var(--purple);
    margin-bottom: 12px;
  }
  .inline-error {
    color: var(--red);
    font-size: 0.87rem;
    line-height: 1.6;
  }
  .mail-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 20px;
  }
  .mail-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: none;
    color: var(--ink);
    padding: 16px 10px;
  }
  .mail-list small {
    color: var(--muted);
    display: block;
    margin-top: 5px;
  }
  .mail-frame {
    width: 100%;
    height: 500px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .field-row {
    display: flex;
    gap: 12px;
    align-items: end;
  }
  .field-row > * {
    flex: 1;
  }
  .local-label {
    font-size: 0.76rem;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .local-label svg {
    width: 14px;
    height: 14px;
  }
  .rendered {
    line-height: 1.8;
    overflow-wrap: anywhere;
  }
  .rendered table {
    border: 1px solid var(--line);
  }
  .rendered h1 {
    font-size: 2rem;
  }
  .rendered h2 {
    font-size: 1.4rem;
  }
  .rendered h3 {
    font-size: 1.2rem;
  }
  .rendered img {
    max-width: 100%;
  }
  @media (max-width: 760px) {
    .product-card {
      padding: 15px;
    }
    .product-name {
      font-size: 0.86rem;
    }
    .product-desc {
      font-size: 0.75rem;
    }
    .product-bottom {
      flex-wrap: wrap;
    }
    .product-bottom .button {
      flex: 1;
    }
    .tool-card {
      padding: 18px;
    }
    .panel {
      padding: 20px;
    }
    .stat-row {
      gap: 10px;
    }
    .stat {
      padding: 15px;
    }
    .stat strong {
      font-size: 1.4rem;
    }
    .howto {
      grid-template-columns: 1fr;
      gap: 22px;
    }
    .howto > div {
      padding-bottom: 15px;
      border-bottom: 1px solid var(--line);
    }
    .howto > div:last-child {
      border: 0;
      padding: 0;
    }
    .mail-layout {
      grid-template-columns: 1fr;
    }
    .mail-list {
      max-height: 280px;
      overflow: auto;
    }
    .comparison-bar {
      bottom: 14px;
      gap: 12px;
    }
    .field-row {
      flex-wrap: wrap;
    }
    .field-row > * {
      min-width: 130px;
    }
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
}
@layer utilities {
  .muted {
    color: var(--muted);
  }
  .text-purple {
    color: var(--purple);
  }
  .center {
    text-align: center;
  }
  .mt {
    margin-top: 24px;
  }
  .mb {
    margin-bottom: 20px;
  }
  .full {
    width: 100%;
  }
  .hidden {
    display: none !important;
  }
  .gap {
    display: grid;
    gap: 18px;
  }
  .small-text {
    font-size: 0.85rem;
  }
  .nowrap {
    white-space: nowrap;
  }
}
@layer components {
  .toolbar select {
    width: auto;
    max-width: 220px;
  }
  .toolbar label.chip {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .wallet-amount {
    font-size: 2.7rem;
    margin-top: 24px;
  }
  .header:has(.preview-note) {
    height: 116px;
  }
  .auth-box .tabs {
    max-width: 100%;
  }
}
@media print {
  .header,
  .footer,
  .workspace-nav,
  .page-head,
  .tabs,
  .actions,
  button,
  .panel:first-child {
    display: none !important;
  }
  .wrap,
  .workspace,
  .two-col {
    display: block;
    max-width: none;
    padding: 0;
  }
  .panel {
    border: 0;
  }
  .result,
  .rendered {
    max-height: none;
    overflow: visible;
  }
  body {
    background: white;
    color: black;
  }
}
@layer components {
  .stock,
  .badge,
  .chip,
  .footer-links {
    font-size: 0.875rem;
  }
  .product-desc {
    font-size: 0.825rem;
  }
  small {
    font-size: 0.875rem;
  }
  :root[data-theme="dark"] .button:not(.secondary):not(.ghost):not(.danger) {
    color: #21152f;
  }
  :root[data-theme="dark"] .hero-art:before {
    background: #302844;
  }
  .release-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--muted);
    margin: 18px 0;
  }
  .api-guide-link {
    color: var(--purple);
  }
}
@layer components {
  .two-col > *:first-child,
  .two-col > *:last-child,
  .workspace > *:last-child,
  .account-layout > *:last-child,
  .header-inner > * {
    min-width: 0;
  }
  .tabs {
    max-width: 100%;
  }
  .summary-line > * {
    overflow-wrap: anywhere;
  }
  .toolbar .search-field {
    min-width: 0;
  }
  .product-grid {
    align-items: stretch;
  }
  .product-name {
    margin-bottom: auto;
  }
  .product-bottom {
    min-height: 54px;
  }
  .chips {
    max-width: 100%;
  }
  @media (max-width: 1050px) {
    .header-actions .theme-btn {
      display: none;
    }
  }
  @media (max-width: 760px) {
    .header-actions .button {
      font-size: 0;
      width: 42px;
      min-width: 42px;
      padding: 10px;
      gap: 0;
    }
    .header-actions .button svg {
      width: 20px;
      height: 20px;
    }
    .nav {
      flex-basis: 100%;
      max-width: 100%;
      flex-shrink: 1;
    }
    .header-actions {
      flex-shrink: 0;
    }
    .hero h1 {
      font-size: 2.75rem;
    }
    .hero-art {
      height: 285px;
      margin-top: 12px;
    }
    .hero-art img {
      height: 300px;
    }
    .hero-label {
      padding: 10px 12px;
      font-size: 0.75rem;
    }
    .hero-label strong {
      font-size: 0.8rem;
    }
    .hero-label small {
      font-size: 0.75rem;
    }
    .product-bottom {
      align-items: stretch;
      flex-direction: column;
    }
    .product-bottom .button {
      width: 100%;
      min-height: 44px;
    }
    .compare {
      width: 36px;
      height: 36px;
    }
    .tabs button {
      min-height: 44px;
    }
    .chip {
      min-height: 40px;
    }
    .comparison-bar {
      max-width: calc(100vw - 24px);
      gap: 8px;
      font-size: 0.75rem;
    }
    .comparison-bar .chip {
      padding: 8px;
    }
    .stat-row {
      grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    }
    .section-head > a {
      font-size: 0.8rem;
    }
    .table-wrap {
      max-width: 100%;
    }
    .result {
      padding: 14px;
    }
    .page-head h1 {
      overflow-wrap: anywhere;
    }
  }
}

@layer components {
  @media (min-width: 361px) and (max-width: 760px) {
    .header-actions .theme-btn {
      display: inline-grid;
    }
  }
}

@layer components {
  .two-col > .panel + .panel,
  .checkout > .panel + .panel {
    margin-top: 0;
  }
}
