:root {
            --bg: #0d1117;
            --surface: #161b22;
            --surface-soft: #1c222b;
            --surface-strong: #222a35;
            --text: #eef4f7;
            --muted: #9aa8b2;
            --border: #2b3440;
            --border-strong: #3a4654;
            --accent: #14b8c8;
            --accent-soft: rgba(20, 184, 200, 0.14);
            --accent-dark: #62e6f0;
            --amber: #e2a72e;
            --danger: #f06d5f;
            --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
            --header-h: 56px;
            --sidebar-w: 236px;
            --radius: 8px;
        }

        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            min-height: 100vh;
            overflow: hidden;
            background: var(--bg);
            color: var(--text);
            font-family: "Microsoft JhengHei", "Segoe UI", Arial, sans-serif;
        }

        button {
            font: inherit;
        }

        .app {
            display: grid;
            grid-template-rows: var(--header-h) minmax(0, 1fr);
            min-height: 100vh;
        }

        .topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            height: var(--header-h);
            padding: 0 18px;
            background: rgba(13, 17, 23, 0.94);
            border-bottom: 1px solid var(--border);
            box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
            z-index: 30;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
        }

        .icon-button {
            display: inline-grid;
            place-items: center;
            width: 38px;
            height: 38px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text);
            cursor: pointer;
            transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
        }

        .icon-button:hover {
            border-color: var(--border-strong);
            background: var(--surface-soft);
            color: var(--accent-dark);
        }

        .brand-mark {
            display: inline-grid;
            place-items: center;
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: linear-gradient(145deg, #17232c, #0b1218);
            color: #f2ffff;
            font-size: 13px;
            font-weight: 800;
            letter-spacing: 0;
        }

        .brand-title {
            min-width: 0;
        }

        .brand-title strong {
            display: block;
            overflow: hidden;
            color: var(--text);
            font-size: 15px;
            line-height: 1.15;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .brand-title span {
            display: block;
            margin-top: 2px;
            color: var(--muted);
            font-size: 12px;
            line-height: 1.2;
        }

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

        .status {
            display: flex;
            align-items: center;
            gap: 8px;
            height: 34px;
            padding: 0 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--muted);
            font-size: 12px;
            white-space: nowrap;
        }

        .status-dot {
            position: relative;
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: #1da861;
            box-shadow: 0 0 0 3px rgba(29, 168, 97, 0.15);
            animation: status-blink 1.8s ease-in-out infinite;
        }

        .status-dot::after {
            content: "";
            position: absolute;
            inset: -5px;
            border-radius: inherit;
            border: 1px solid rgba(29, 168, 97, 0.36);
            opacity: 0;
            transform: scale(0.72);
            animation: status-breathe 2.4s ease-in-out infinite;
        }

        .shell {
            position: relative;
            display: grid;
            grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
            height: calc(100vh - var(--header-h));
            min-height: 0;
            overflow: hidden;
            overflow: clip;
            overscroll-behavior: none;
            transition: grid-template-columns 0.22s ease;
        }

        .shell.sidebar-collapsed {
            grid-template-columns: 0 minmax(0, 1fr);
        }

        .shell.sidebar-collapsed .sidebar {
            transform: translateX(-100%);
            padding-right: 0;
            padding-left: 0;
            border-right-color: transparent;
        }

        .sidebar {
            display: flex;
            min-width: 0;
            min-height: 0;
            flex-direction: column;
            gap: 14px;
            overflow-x: hidden;
            overflow-y: auto;
            scrollbar-width: none;
            padding: 16px 12px;
            background: #111821;
            border-right: 1px solid var(--border);
            transition: transform 0.22s ease, padding 0.22s ease, border-color 0.22s ease;
            z-index: 20;
        }

        .sidebar::-webkit-scrollbar {
            display: none;
        }

        .sidebar-section-title {
            padding: 0 10px;
            color: #738391;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .nav-list {
            display: grid;
            gap: 6px;
        }

        .manager-nav-slot {
            margin-top: 6px;
        }

        .nav-item {
            display: grid;
            grid-template-columns: 34px minmax(0, 1fr) 18px;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 9px 9px;
            border: 1px solid transparent;
            border-radius: 8px;
            background: transparent;
            color: var(--text);
            text-align: left;
            cursor: pointer;
            transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
        }

        .nav-item:hover {
            border-color: var(--border);
            background: rgba(255, 255, 255, 0.04);
        }

        .nav-item.active {
            border-color: rgba(20, 184, 200, 0.42);
            background: var(--accent-soft);
            color: var(--accent-dark);
        }

        .service-icon {
            display: grid;
            place-items: center;
            width: 34px;
            height: 34px;
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 8px;
            background: var(--surface);
            color: currentColor;
        }

        .nav-copy {
            min-width: 0;
        }

        .nav-copy strong {
            display: block;
            overflow: hidden;
            color: inherit;
            font-size: 13px;
            font-weight: 800;
            line-height: 1.2;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .nav-copy span {
            display: block;
            overflow: hidden;
            margin-top: 2px;
            color: var(--muted);
            font-size: 11px;
            line-height: 1.2;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .chevron {
            display: grid;
            place-items: center;
            color: #6f7d89;
        }

        .sidebar-footer {
            margin-top: 2px;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.035);
        }

        .sidebar-footer strong {
            display: block;
            font-size: 12px;
            line-height: 1.25;
        }

        .sidebar-footer span {
            display: block;
            margin-top: 5px;
            color: var(--muted);
            font-size: 11px;
            line-height: 1.45;
        }

        .content {
            min-width: 0;
            overflow: hidden;
            overscroll-behavior: none;
            background:
                radial-gradient(circle at 92% 8%, rgba(20, 184, 200, 0.10), transparent 240px),
                linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(13, 17, 23, 0) 220px),
                var(--bg);
        }

        .workspace {
            display: grid;
            grid-template-rows: auto minmax(0, 1fr);
            height: calc(100vh - var(--header-h));
            min-width: 0;
            padding: 18px;
            gap: 14px;
            overflow: hidden;
            overscroll-behavior: none;
        }

        .page-head {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            gap: 14px;
        }

        .page-kicker {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.2;
        }

        .page-title {
            margin: 5px 0 0;
            color: var(--text);
            font-size: 24px;
            line-height: 1.15;
            letter-spacing: 0;
        }

        .page-description {
            max-width: 660px;
            margin-top: 8px;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.55;
        }

        .primary-button,
        .secondary-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-height: 38px;
            padding: 0 13px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 800;
            cursor: pointer;
            transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
        }

        .primary-button {
            border: 1px solid rgba(98, 230, 240, 0.34);
            background: var(--accent);
            color: #041114;
        }

        .primary-button:hover {
            background: #63e7ef;
        }

        .primary-button.is-dirty {
            box-shadow: 0 0 0 3px rgba(20, 184, 200, 0.14);
        }

        .secondary-button {
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text);
        }

        .secondary-button:hover {
            border-color: var(--border-strong);
            background: var(--surface-soft);
        }

        .primary-button:active,
        .secondary-button:active,
        .icon-button:active,
        .nav-item:active,
        .service-card:active {
            transform: translateY(1px);
        }

        .panel {
            min-width: 0;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: rgba(22, 27, 34, 0.94);
            box-shadow: var(--shadow);
        }

        .home-grid {
            display: grid;
            grid-template-columns: minmax(320px, 0.62fr) minmax(560px, 1.38fr);
            align-items: start;
            gap: 14px;
            overflow: auto;
            min-height: 0;
        }

        .summary-panel {
            display: grid;
            grid-template-rows: auto auto auto minmax(0, 1fr);
            min-height: 0;
            padding: 18px;
        }

        .summary-title {
            margin: 0;
            color: var(--text);
            font-size: 18px;
            line-height: 1.25;
        }

        .summary-copy {
            margin: 8px 0 16px;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.6;
        }

        .quick-stats {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 9px;
            margin-bottom: 16px;
        }

        .stat {
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface-soft);
        }

        .stat span {
            display: block;
            color: var(--muted);
            font-size: 11px;
            line-height: 1.2;
        }

        .stat strong {
            display: block;
            margin-top: 7px;
            color: var(--text);
            font-size: 18px;
            line-height: 1.1;
        }

        .activity {
            overflow: auto;
            min-height: 0;
            padding-right: 3px;
        }

        .activity-row {
            display: grid;
            grid-template-columns: 10px minmax(0, 1fr);
            gap: 10px;
            padding: 11px 0;
            border-top: 1px solid var(--border);
        }

        .activity-dot {
            width: 8px;
            height: 8px;
            margin-top: 5px;
            border-radius: 999px;
            background: var(--accent);
        }

        .activity-row:nth-child(2) .activity-dot {
            background: var(--amber);
        }

        .activity-row:nth-child(3) .activity-dot {
            background: #81909c;
        }

        .activity-row strong {
            display: block;
            font-size: 12px;
            line-height: 1.3;
        }

        .activity-row span {
            display: block;
            margin-top: 3px;
            color: var(--muted);
            font-size: 12px;
            line-height: 1.45;
        }

        .services-panel {
            display: grid;
            grid-template-rows: auto minmax(0, 1fr);
            min-height: 0;
            padding: 18px;
        }

        .panel-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }

        .panel-head h2 {
            margin: 0;
            color: var(--text);
            font-size: 17px;
            line-height: 1.25;
        }

        .panel-head span {
            color: var(--muted);
            font-size: 12px;
            white-space: nowrap;
        }

        .service-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
            overflow: auto;
            min-height: 0;
            padding-right: 3px;
            align-content: start;
        }

        .service-card {
            display: grid;
            grid-template-columns: 40px minmax(0, 1fr);
            gap: 12px;
            width: 100%;
            min-height: 92px;
            padding: 13px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text);
            text-align: left;
            cursor: pointer;
            transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
        }

        .service-card:hover {
            border-color: rgba(20, 184, 200, 0.5);
            box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
        }

        .service-card.active {
            border-color: rgba(98, 230, 240, 0.58);
            background: rgba(20, 184, 200, 0.08);
        }

        .card-icon {
            display: grid;
            place-items: center;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            background: var(--accent-soft);
            color: var(--accent-dark);
        }

        .card-copy {
            min-width: 0;
        }

        .card-copy strong {
            display: block;
            color: var(--text);
            font-size: 14px;
            line-height: 1.25;
        }

        .card-copy span {
            display: block;
            margin-top: 5px;
            color: var(--muted);
            font-size: 12px;
            line-height: 1.45;
        }

        .card-port {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 9px;
            color: var(--accent-dark);
            font-size: 11px;
            font-weight: 800;
            line-height: 1.2;
        }

        .frame-shell {
            display: none;
            grid-template-rows: auto minmax(0, 1fr);
            min-height: 0;
        }

        .frame-shell.active {
            display: grid;
        }

        .frame-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
            background: rgba(22, 27, 34, 0.95);
        }

        .frame-meta {
            display: flex;
            align-items: center;
            min-width: 0;
            gap: 10px;
        }

        .frame-meta .service-icon {
            flex: 0 0 auto;
            color: var(--accent-dark);
        }

        .frame-meta strong {
            display: block;
            overflow: hidden;
            color: var(--text);
            font-size: 14px;
            line-height: 1.2;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .frame-meta span {
            display: block;
            overflow: hidden;
            margin-top: 3px;
            color: var(--muted);
            font-size: 12px;
            line-height: 1.2;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .frame-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 0 0 auto;
        }

        .frame-area {
            position: relative;
            min-height: 0;
            background: #080b0f;
        }

        .frame-placeholder {
            position: absolute;
            inset: 0;
            display: grid;
            place-items: center;
            padding: 24px;
            color: rgba(255, 255, 255, 0.78);
            text-align: center;
        }

        .frame-placeholder-inner {
            max-width: 520px;
        }

        .frame-placeholder h2 {
            margin: 0;
            color: white;
            font-size: 22px;
            line-height: 1.2;
        }

        .frame-placeholder p {
            margin: 10px 0 0;
            font-size: 13px;
            line-height: 1.55;
        }

        iframe {
            position: relative;
            z-index: 1;
            display: block;
            width: 100%;
            height: 100%;
            min-height: 0;
            border: 0;
            background: white;
        }

        .frame-notice[hidden] {
            display: none;
        }

        .frame-notice {
            position: absolute;
            inset: 0;
            z-index: 4;
            display: grid;
            place-items: center;
            padding: 24px;
            background: rgba(8, 11, 15, 0.76);
            color: var(--text);
        }

        .frame-notice__box {
            width: min(560px, 100%);
            padding: 18px;
            border: 1px solid rgba(98, 230, 240, 0.2);
            border-radius: 10px;
            background: rgba(18, 25, 37, 0.94);
            box-shadow: 0 22px 58px rgba(0, 0, 0, 0.36);
        }

        .frame-notice h2 {
            margin: 0;
            font-size: 20px;
            line-height: 1.2;
        }

        .frame-notice p {
            margin: 10px 0 0;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.55;
        }

        .frame-notice__actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 16px;
        }

        .loader-overlay {
            position: absolute;
            inset: 0;
            z-index: 5;
            display: grid;
            place-items: center;
            background: rgba(12, 22, 25, 0.72);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.18s ease;
        }

        .loader-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        .loader-box {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 8px;
            background: rgba(16, 26, 29, 0.86);
            color: white;
            font-size: 13px;
        }

        .spinner {
            width: 18px;
            height: 18px;
            border: 3px solid rgba(255, 255, 255, 0.28);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.85s linear infinite;
        }

        .overlay {
            position: fixed;
            inset: var(--header-h) 0 0 0;
            z-index: 15;
            background: rgba(15, 26, 29, 0.38);
            opacity: 0;
            pointer-events: none;
            backdrop-filter: blur(5px);
            transition: opacity 0.22s ease;
        }

        .overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        .toast {
            position: fixed;
            right: 18px;
            bottom: 18px;
            z-index: 60;
            max-width: min(360px, calc(100vw - 36px));
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            box-shadow: var(--shadow);
            color: var(--text);
            font-size: 13px;
            line-height: 1.45;
            transform: translateY(18px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.18s ease, transform 0.18s ease;
        }

        .toast.active {
            transform: translateY(0);
            opacity: 1;
        }

        .link-manager[hidden] {
            display: none;
        }

        .link-manager {
            display: grid;
            grid-template-rows: auto auto minmax(0, 1fr);
            min-height: 0;
            overflow: hidden;
        }

        .link-manager__head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 16px;
            border-bottom: 1px solid var(--border);
        }

        .link-manager__head h2 {
            margin: 4px 0 0;
            color: var(--text);
            font-size: 20px;
            line-height: 1.2;
        }

        .link-manager__actions {
            display: flex;
            align-items: center;
            gap: 9px;
        }

        .link-add-panel[hidden] {
            display: grid;
            visibility: hidden;
            pointer-events: none;
        }

        .link-add-panel {
            position: fixed;
            inset: 0;
            z-index: 70;
            display: grid;
            place-items: center;
            padding: 24px;
            visibility: hidden;
            pointer-events: none;
            background:
                radial-gradient(circle at 50% 42%, rgba(20, 184, 200, 0.08), transparent 34%),
                rgba(6, 10, 18, 0.68);
            opacity: 0;
            backdrop-filter: none;
            transition: opacity 0.11s ease, visibility 0s linear 0.11s;
            contain: layout paint;
            will-change: opacity;
        }

        .link-add-panel.is-open {
            visibility: visible;
            pointer-events: auto;
            opacity: 1;
            transition: opacity 0.11s ease;
        }

        .link-add-panel .link-form {
            width: min(720px, calc(100vw - 32px));
            max-height: calc(100vh - 48px);
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            overflow: auto;
            scrollbar-width: none;
            padding: 18px;
            border: 1px solid rgba(98, 230, 240, 0.18);
            border-radius: 12px;
            background: linear-gradient(180deg, rgba(21, 29, 43, 0.98), rgba(12, 17, 28, 0.98));
            box-shadow: 0 22px 62px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
            opacity: 0;
            transform: translateY(4px) scale(0.992);
            transition: opacity 0.12s ease, transform 0.12s ease;
            will-change: opacity, transform;
        }

        .link-add-panel.is-open .link-form {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        .link-add-panel .link-form::-webkit-scrollbar {
            display: none;
        }

        .link-form__head {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding-bottom: 4px;
        }

        .link-form__head h3 {
            margin: 3px 0 0;
            color: var(--text);
            font-size: 20px;
            line-height: 1.2;
        }

        .link-form label,
        .toggle-line {
            display: grid;
            gap: 6px;
            color: var(--muted);
            font-size: 11px;
            font-weight: 800;
            line-height: 1.2;
        }

        .link-form input,
        .link-form select {
            width: 100%;
            min-height: 38px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text);
            font: inherit;
            font-size: 13px;
            outline: none;
            padding: 0 10px;
        }

        .link-form input:focus,
        .link-form select:focus {
            border-color: rgba(98, 230, 240, 0.58);
            box-shadow: 0 0 0 3px rgba(20, 184, 200, 0.12);
        }

        .link-form .toggle-line {
            display: flex;
            align-items: center;
            gap: 8px;
            min-height: 38px;
            color: var(--text);
            white-space: nowrap;
        }

        .modal-submit {
            grid-column: 1 / -1;
            justify-self: end;
            min-width: 128px;
        }

        .toggle-line input {
            width: 16px;
            min-height: 16px;
            height: 16px;
            accent-color: var(--accent);
        }

        .link-manager__list {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            align-content: start;
            gap: 12px;
            overflow: auto;
            overscroll-behavior: contain;
            padding: 12px 16px 16px;
            scrollbar-width: none;
        }

        .link-manager__list::-webkit-scrollbar {
            display: none;
        }

        .link-list-header {
            display: none;
            grid-template-columns: minmax(220px, 1fr) 104px 112px 176px;
            gap: 10px;
            align-items: center;
            padding: 0 12px 8px;
            color: var(--muted);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.03em;
            text-transform: uppercase;
        }

        .link-row {
            position: relative;
            display: grid;
            grid-template-rows: auto auto auto;
            gap: 12px;
            align-items: stretch;
            min-height: 160px;
            overflow: hidden;
            padding: 14px 94px 14px 14px;
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 8px;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
                var(--surface);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
            transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
        }

        .link-row:hover {
            border-color: rgba(98, 230, 240, 0.24);
            box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
            transform: translateY(-1px);
        }

        .link-row__title {
            min-width: 0;
        }

        .link-row__title strong {
            display: block;
            overflow: hidden;
            color: var(--text);
            font-size: 14px;
            line-height: 1.25;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .link-row__title span,
        .link-row__meta {
            display: block;
            overflow: hidden;
            margin-top: 3px;
            color: var(--muted);
            font-size: 11px;
            line-height: 1.35;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .link-row__details {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .link-detail {
            display: grid;
            gap: 5px;
            min-width: 0;
        }

        .link-detail__label {
            color: #718190;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.04em;
            line-height: 1.1;
            text-transform: uppercase;
        }

        .link-row__tag {
            display: inline-flex;
            align-items: center;
            justify-content: flex-start;
            min-height: 28px;
            padding: 0 8px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--muted);
            font-size: 11px;
            font-weight: 800;
            white-space: nowrap;
        }

        .link-row__switches {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 18px;
            min-width: 0;
            padding-top: 2px;
        }

        .link-row__bottom {
            position: absolute;
            top: 12px;
            right: 12px;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 8px;
            padding-top: 0;
            z-index: 2;
        }

        .small-toggle {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            width: fit-content;
            color: var(--muted);
            font-size: 11px;
            font-weight: 800;
            white-space: nowrap;
            cursor: pointer;
            user-select: none;
        }

        .small-toggle input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .switch-track {
            position: relative;
            display: inline-flex;
            align-items: center;
            width: 42px;
            height: 24px;
            border: 1px solid var(--border-strong);
            border-radius: 999px;
            background: #0b1118;
            box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.34);
            transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
        }

        .switch-track::before {
            content: "";
            position: absolute;
            inset: -4px;
            border-radius: inherit;
            background: rgba(98, 230, 240, 0.10);
            opacity: 0;
            transform: scale(0.82);
            transition: opacity 0.18s ease, transform 0.18s ease;
        }

        .switch-track::after {
            content: "";
            position: absolute;
            left: 3px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #7d8995;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
            transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
        }

        .small-toggle:hover .switch-track {
            border-color: rgba(98, 230, 240, 0.34);
            transform: translateY(-1px);
        }

        .small-toggle:active .switch-track {
            transform: scale(0.96);
        }

        .small-toggle input:checked ~ .switch-track {
            border-color: rgba(98, 230, 240, 0.48);
            background: rgba(20, 184, 200, 0.18);
            box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(20, 184, 200, 0.08);
        }

        .small-toggle input:checked ~ .switch-track::before {
            opacity: 1;
            transform: scale(1);
        }

        .small-toggle input:checked ~ .switch-track::after {
            transform: translateX(18px);
            background: var(--accent-dark);
            box-shadow: 0 0 10px rgba(98, 230, 240, 0.34);
            animation: switch-pop 0.22s ease;
        }

        .link-row__action {
            display: inline-grid;
            place-items: center;
            width: 34px;
            height: 34px;
            border: 1px solid rgba(240, 109, 95, 0.28);
            border-radius: 8px;
            background: rgba(240, 109, 95, 0.08);
            color: #ffaaa1;
            cursor: pointer;
            transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
        }

        .link-row__edit {
            border-color: rgba(98, 230, 240, 0.22);
            background: rgba(20, 184, 200, 0.07);
            color: var(--accent-dark);
        }

        .link-row__edit:hover {
            border-color: rgba(98, 230, 240, 0.42);
            background: rgba(20, 184, 200, 0.12);
            transform: translateY(-1px);
        }

        .link-row.is-deletable {
            border-color: rgba(240, 109, 95, 0.22);
            background:
                linear-gradient(180deg, rgba(240, 109, 95, 0.055), rgba(255, 255, 255, 0.012)),
                var(--surface);
            animation: delete-card-ready 0.36s ease;
        }

        .link-row.is-deletable .link-row__delete {
            border-color: rgba(240, 109, 95, 0.46);
            background: rgba(240, 109, 95, 0.12);
            box-shadow: 0 0 0 3px rgba(240, 109, 95, 0.08);
            animation: delete-ready 0.32s ease;
        }

        .link-row.is-deletable .link-row__delete:hover {
            border-color: rgba(240, 109, 95, 0.55);
            background: rgba(240, 109, 95, 0.14);
            box-shadow: 0 0 0 4px rgba(240, 109, 95, 0.10);
            transform: translateY(-1px);
        }

        .link-row.is-deletable .link-row__delete:active {
            transform: scale(0.96);
        }

        .link-row__action:disabled {
            border-color: var(--border);
            background: transparent;
            color: #687682;
            cursor: default;
        }

        .link-row__action:disabled:hover {
            transform: none;
        }

        .icon-only-command {
            width: 38px;
            min-width: 38px;
            padding: 0;
        }

        .manager-button {
            margin-top: 6px;
            border-color: transparent;
            background: transparent;
            color: var(--text);
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
        }

        svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            fill: none;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes status-breathe {
            0%, 100% {
                opacity: 0;
                transform: scale(0.72);
            }

            45% {
                opacity: 1;
                transform: scale(1.12);
            }
        }

        @keyframes status-blink {
            0%, 100% {
                opacity: 0.58;
                box-shadow: 0 0 0 3px rgba(29, 168, 97, 0.10);
            }

            50% {
                opacity: 1;
                box-shadow: 0 0 0 3px rgba(29, 168, 97, 0.18);
            }
        }

        @keyframes switch-pop {
            0% {
                transform: translateX(18px) scale(0.82);
            }

            70% {
                transform: translateX(18px) scale(1.08);
            }

            100% {
                transform: translateX(18px) scale(1);
            }
        }

        @keyframes delete-ready {
            0% {
                opacity: 0.62;
                transform: scale(0.96);
            }

            100% {
                opacity: 1;
                transform: scale(1);
            }
        }

        @keyframes delete-card-ready {
            0% {
                box-shadow: 0 0 0 rgba(240, 109, 95, 0);
            }

            55% {
                box-shadow: 0 0 0 4px rgba(240, 109, 95, 0.08);
            }

            100% {
                box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .status-dot,
            .status-dot::after,
            .spinner,
            .small-toggle input:checked ~ .switch-track::after,
            .link-row.is-deletable,
            .link-row.is-deletable .link-row__delete {
                animation: none;
            }
        }

        @media (max-width: 1380px) {
            .link-manager__list {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 980px) {
            .shell {
                grid-template-columns: 1fr;
            }

            .shell.sidebar-collapsed {
                grid-template-columns: 1fr;
            }

            .shell.sidebar-collapsed .sidebar {
                padding: 16px 12px;
                border-right-color: var(--border);
            }

            .sidebar {
                position: fixed;
                top: var(--header-h);
                bottom: 0;
                left: 0;
                width: min(var(--sidebar-w), calc(100vw - 48px));
                transform: translateX(-100%);
            }

            .sidebar.open {
                transform: translateX(0);
            }

            .home-grid {
                grid-template-columns: 1fr;
                overflow: auto;
            }

            .link-form {
                grid-template-columns: 1fr 1fr;
            }

            .link-list-header {
                display: none;
            }

            .link-form .primary-button {
                grid-column: 1 / -1;
            }

            .summary-panel,
            .services-panel {
                min-height: 320px;
            }

            .frame-shell.active {
                min-height: calc(100vh - var(--header-h) - 36px);
            }
        }

        @media (max-width: 720px) {
            .topbar {
                padding: 0 12px;
            }

            .brand-title span,
            .status {
                display: none;
            }

            .workspace {
                padding: 14px;
            }

            .page-head,
            .frame-toolbar {
                align-items: stretch;
                flex-direction: column;
            }

            .frame-actions {
                justify-content: flex-start;
            }

            .page-title {
                font-size: 21px;
            }

            .service-grid,
            .quick-stats {
                grid-template-columns: 1fr;
            }

            .link-manager {
                min-height: calc(100vh - var(--header-h) - 36px);
            }

            .link-manager__list {
                grid-template-columns: 1fr;
            }

            .link-form {
                grid-template-columns: 1fr;
            }

            .link-row__switches {
                flex-wrap: wrap;
            }

            .link-row__details {
                grid-template-columns: 1fr;
            }
        }
