/* KOTOLINK-HEALTH-NOTEBOOK-IMPL-01 */

      :root {
        --ink: #121826;
        --muted: #44506a;
        --paper: #f3f5fb;
        --card: #ffffff;
        --line: #cfd6ea;
        --brand: #3b5bdb;
        --brand-deep: #2a439f;
        --soft: #e8edfb;
        --warn: #9a5b12;
        --warn-bg: #fff6ea;
        --shadow: 0 16px 36px rgba(15, 40, 40, 0.08);
        --font-display: "Figtree", "Zen Kaku Gothic New", sans-serif;
        --font-body: "Zen Kaku Gothic New", sans-serif;
        --text-xs: 0.875rem;
        --text-sm: 0.9375rem;
        --text-base: 1.0625rem;
        --text-md: 1.125rem;
        --text-lg: 1.28rem;
        --tab-h: 3.85rem;
        --safe-bottom: env(safe-area-inset-bottom, 0px);
      }

      * {
        box-sizing: border-box;
      }

      html,
      body {
        margin: 0;
        padding: 0;
        min-height: 100%;
        color: var(--ink);
        font-family: var(--font-body);
        font-size: 17px;
        line-height: 1.65;
        -webkit-text-size-adjust: 100%;
        background:
          radial-gradient(900px 380px at 10% -10%, #dfe6ff 0%, transparent 55%),
          radial-gradient(700px 320px at 100% 0%, #fff3df 0%, transparent 48%),
          var(--paper);
      }

      .mock-banner {
        max-width: 520px;
        margin: 0 auto;
        padding: 0.65rem 1rem;
        background: #1a2e2e;
        color: #f3fafa;
        font-size: var(--text-sm);
      }

      .mock-banner strong {
        font-weight: 700;
      }

      .mock-banner code {
        font-size: 0.85em;
        opacity: 0.9;
      }

      .phone {
        max-width: 520px;
        margin: 0 auto;
        min-height: 100vh;
        padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 1.25rem);
      }

      .site-header {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 0.85rem 1.15rem;
        background: rgba(255, 255, 255, 0.94);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(8px);
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        min-width: 0;
        text-decoration: none;
        color: inherit;
      }

      .brand__mark {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        flex-shrink: 0;
        display: block;
        object-fit: cover;
        background: var(--soft);
      }

      .pict {
        width: 40px;
        height: 40px;
        object-fit: contain;
        flex-shrink: 0;
      }

      .pict--sm {
        width: 28px;
        height: 28px;
      }

      .pict--tab {
        width: 26px;
        height: 26px;
        margin: 0 auto 0.15rem;
        display: block;
      }

      .brand__kicker {
        display: block;
        color: var(--muted);
        font-size: var(--text-xs);
        line-height: 1.3;
      }

      .brand__title {
        display: block;
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 1.05rem;
        letter-spacing: -0.01em;
      }

      .site-header__free {
        flex-shrink: 0;
        color: var(--brand);
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 0.78rem;
        letter-spacing: 0.08em;
      }

      .app-bar {
        padding: 1rem 1.15rem 0.35rem;
      }

      .app-bar__brand {
        margin: 0;
        color: var(--brand);
        font-family: var(--font-display);
        font-weight: 700;
        font-size: var(--text-xs);
        letter-spacing: 0.03em;
      }

      .app-bar h1 {
        margin: 0.2rem 0 0;
        font-family: var(--font-display);
        font-size: var(--text-lg);
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1.35;
      }

      .lead {
        margin: 0.45rem 0 0;
        color: var(--muted);
        font-size: var(--text-sm);
        line-break: strict;
      }

      .panel {
        display: none;
        padding: 0.75rem 1.15rem 1.5rem;
      }

      .panel.is-active {
        display: block;
      }

      .card {
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 18px;
        box-shadow: var(--shadow);
        padding: 1rem 1.05rem;
      }

      .card + .card {
        margin-top: 0.85rem;
      }

      .empty {
        text-align: left;
        padding: 1.15rem 0.15rem 0.35rem;
      }

      .empty h2 {
        margin: 0 0 0.4rem;
        font-size: var(--text-md);
        font-weight: 700;
      }

      .empty p {
        margin: 0;
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .today-list {
        display: grid;
        gap: 0.7rem;
        margin: 0.85rem 0 0;
      }

      .entry {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 0.5rem 0.75rem;
        align-items: center;
        padding: 0.9rem 1rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fbfdfe;
      }

      .entry .pict {
        width: 36px;
        height: 36px;
      }

      .entry__label {
        margin: 0;
        font-weight: 700;
        font-size: var(--text-md);
      }

      .entry__meta {
        margin: 0.15rem 0 0;
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .entry__value {
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 1.2rem;
        color: var(--brand-deep);
        text-align: right;
      }

      .entry__unit {
        display: block;
        margin-top: 0.1rem;
        color: var(--muted);
        font-size: var(--text-xs);
        font-weight: 500;
      }

      .section-title {
        margin: 1.15rem 0 0.65rem;
        font-size: var(--text-md);
        font-weight: 700;
      }

      .quick-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
      }

      .quick {
        min-height: 3.5rem;
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 0.65rem 0.75rem;
        padding: 0.85rem 0.95rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--card);
        text-align: left;
        cursor: pointer;
        font: inherit;
        color: inherit;
      }

      .quick .quick__text {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        min-width: 0;
      }

      .quick:hover,
      .quick:focus-visible {
        border-color: var(--brand);
        outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
        outline-offset: 1px;
      }

      .quick strong {
        font-size: var(--text-md);
        font-weight: 700;
      }

      .quick span {
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .soft-link {
        margin-top: 0.95rem;
        padding: 0.95rem 1rem;
        border-radius: 14px;
        background: var(--soft);
        border: 1px solid #c5d0f0;
      }

      .soft-link p {
        margin: 0 0 0.55rem;
        font-size: var(--text-sm);
        color: var(--muted);
      }

      .soft-link a,
      .text-link {
        color: var(--brand-deep);
        font-weight: 700;
        font-size: var(--text-sm);
        text-decoration: underline;
        text-underline-offset: 2px;
      }

      .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 3rem;
        width: 100%;
        padding: 0.7rem 1rem;
        border-radius: 12px;
        border: 1px solid transparent;
        font: inherit;
        font-weight: 700;
        font-size: var(--text-md);
        cursor: pointer;
      }

      .btn--primary {
        background: var(--brand);
        color: #fff;
      }

      .btn--ghost {
        background: #fff;
        border-color: var(--line);
        color: var(--ink);
      }

      .btn-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        margin-top: 0.85rem;
      }

      .after-save {
        display: none;
        margin-top: 0.85rem;
        padding: 0.85rem 1rem;
        border-radius: 12px;
        background: var(--warn-bg);
        border: 1px solid #f0d7b0;
        color: var(--warn);
        font-size: var(--text-sm);
      }

      .after-save.is-on {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
      }

      .after-save button {
        flex-shrink: 0;
        border: 0;
        background: transparent;
        color: var(--warn);
        font: inherit;
        font-size: var(--text-md);
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
      }

      .type-list {
        display: grid;
        gap: 0.65rem;
      }

      .type-row {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 0.75rem;
        min-height: 3.5rem;
        padding: 0.85rem 1rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--card);
        cursor: pointer;
        font: inherit;
        text-align: left;
        color: inherit;
      }

      .type-row strong {
        display: block;
        font-size: var(--text-md);
      }

      .type-row span {
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .type-row__go {
        color: var(--brand);
        font-weight: 800;
        font-size: var(--text-md);
      }

      .history-list {
        display: grid;
        gap: 0.65rem;
      }

      .history-item {
        padding: 0.9rem 1rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--card);
      }

      .history-item strong {
        display: block;
        font-size: var(--text-md);
      }

      .history-item p {
        margin: 0.2rem 0 0;
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .settings-list {
        display: grid;
        gap: 0.65rem;
      }

      .settings-card {
        padding: 1rem 1.05rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--card);
      }

      .settings-card h2 {
        margin: 0 0 0.35rem;
        font-size: var(--text-md);
      }

      .settings-card p {
        margin: 0;
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .settings-card ul {
        margin: 0.55rem 0 0;
        padding-left: 1.15rem;
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .settings-card li + li {
        margin-top: 0.25rem;
      }

      .tabbar {
        position: fixed;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 100%;
        max-width: 520px;
        min-height: calc(var(--tab-h) + var(--safe-bottom));
        padding: 0.35rem 0.4rem calc(0.45rem + var(--safe-bottom));
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.2rem;
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--line);
        z-index: 30;
      }

      .tab {
        min-height: 3.2rem;
        border: 0;
        background: transparent;
        border-radius: 12px;
        color: var(--muted);
        font: inherit;
        font-size: var(--text-sm);
        font-weight: 700;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.35rem 0.2rem;
      }

      .tab img {
        opacity: 0.72;
      }

      .tab[aria-selected="true"] img {
        opacity: 1;
      }

      .tab[aria-selected="true"] {
        color: var(--brand-deep);
        background: var(--soft);
      }

      .sheet {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: none;
        align-items: flex-end;
        justify-content: center;
        background: rgba(12, 28, 28, 0.42);
      }

      .sheet.is-open {
        display: flex;
      }

      .sheet__panel {
        width: 100%;
        max-width: 520px;
        max-height: min(88vh, 640px);
        overflow: auto;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 1rem 1.15rem calc(1.25rem + var(--safe-bottom));
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.12);
      }

      .sheet__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.85rem;
      }

      .sheet__head h2 {
        margin: 0;
        font-size: var(--text-lg);
      }

      .icon-btn {
        min-width: 44px;
        min-height: 44px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        font: inherit;
        font-size: var(--text-md);
        cursor: pointer;
      }

      .field {
        display: grid;
        gap: 0.35rem;
        margin-bottom: 0.85rem;
      }

      .field span {
        font-weight: 700;
        font-size: var(--text-sm);
      }

      .field input,
      .field textarea {
        width: 100%;
        min-height: 3rem;
        padding: 0.7rem 0.85rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        font: inherit;
        font-size: 16px;
        background: #fff;
        color: var(--ink);
      }

      .field textarea {
        min-height: 5rem;
        resize: vertical;
      }

      .bp-row {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 0.5rem;
        align-items: end;
      }

      .bp-row .slash {
        padding-bottom: 0.85rem;
        font-weight: 800;
        color: var(--muted);
      }

      .toast {
        position: fixed;
        left: 50%;
        bottom: calc(var(--tab-h) + var(--safe-bottom) + 1rem);
        transform: translateX(-50%) translateY(12px);
        max-width: calc(100% - 2rem);
        padding: 0.7rem 1rem;
        border-radius: 12px;
        background: #173333;
        color: #fff;
        font-size: var(--text-sm);
        opacity: 0;
        pointer-events: none;
        transition: 0.2s ease;
        z-index: 50;
      }

      .toast.is-on {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }

      .hero-action {
        display: grid;
        gap: 0.75rem;
      }

      .hero-action__head {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
        align-items: center;
      }

      .hero-action__head h2 {
        margin: 0;
        font-size: var(--text-md);
        font-weight: 700;
      }

      .hero-action__head p {
        margin: 0.2rem 0 0;
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .steps-value {
        margin: 0.35rem 0 0;
        font-family: var(--font-display);
        font-weight: 800;
        font-size: 1.65rem;
        color: var(--brand-deep);
        line-height: 1.2;
      }

      .steps-value span {
        display: inline-block;
        margin-left: 0.25rem;
        font-size: var(--text-sm);
        font-weight: 500;
        color: var(--muted);
      }

      .note-chip {
        display: inline-block;
        margin-top: 0.45rem;
        padding: 0.25rem 0.55rem;
        border-radius: 8px;
        background: var(--soft);
        color: var(--brand-deep);
        font-size: var(--text-xs);
        font-weight: 700;
      }

      .photo-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
      }

      .manual-fold {
        margin-top: 0.35rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--card);
        padding: 0.35rem 0.85rem 0.85rem;
      }

      .manual-fold > summary {
        cursor: pointer;
        list-style: none;
        min-height: 3rem;
        display: flex;
        align-items: center;
        font-weight: 700;
        font-size: var(--text-md);
        color: var(--muted);
      }

      .manual-fold > summary::-webkit-details-marker {
        display: none;
      }

      .manual-fold > summary::after {
        content: "＋";
        margin-left: auto;
        color: var(--brand);
        font-weight: 800;
      }

      .manual-fold[open] > summary::after {
        content: "−";
      }

      .manual-fold .quick-grid {
        margin-top: 0.35rem;
      }

      .photo-preview {
        display: none;
        margin: 0 0 0.85rem;
        border: 1px solid var(--line);
        border-radius: 14px;
        overflow: hidden;
        background: #f7fbfb;
      }

      .photo-preview.is-on {
        display: block;
      }

      .photo-preview img {
        display: block;
        width: 100%;
        max-height: 180px;
        object-fit: cover;
      }

      .photo-preview__cap {
        margin: 0;
        padding: 0.65rem 0.85rem;
        color: var(--warn);
        background: var(--warn-bg);
        font-size: var(--text-sm);
      }

      .file-btn {
        position: relative;
        overflow: hidden;
      }

      .file-btn input[type="file"] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
        font-size: 0;
      }

      .link-status {
        margin: 0.55rem 0 0;
        color: var(--muted);
        font-size: var(--text-sm);
      }

      .install-hint {
        position: fixed;
        left: 50%;
        bottom: calc(var(--tab-h) + var(--safe-bottom) + 4.5rem);
        transform: translateX(-50%);
        width: min(520px, calc(100% - 2rem));
        z-index: 25;
        display: none;
        justify-content: space-between;
        gap: 0.75rem;
        align-items: flex-start;
        box-sizing: border-box;
      }

      .install-hint:not([hidden]) {
        display: flex;
      }

      #steps-linked .btn-row {
        grid-template-columns: 1fr;
      }

      @media (min-width: 400px) {
        #steps-linked .btn-row {
          grid-template-columns: 1fr 1fr;
        }
        #steps-linked .btn-row .btn--primary {
          grid-column: 1 / -1;
        }
      }

      @media (max-width: 380px) {
        .quick-grid,
        .photo-grid {
          grid-template-columns: 1fr;
        }
      }
    