:root { --bg: #0f1014; --panel: #171a21; --line: #262a35; --text: #d8d8e0;
        --dim: #8b93a7; --green: #7ee787; --yellow: #e3b341; --red: #ff7b72; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
             font: 15px/1.35 -apple-system, system-ui, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { max-width: 640px; margin: 0 auto;
        padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 40px; }
h1 { font-size: 22px; margin: 4px 0 14px; display: flex; align-items: center; gap: 10px; }
h1 .sub { font-size: 12px; color: var(--dim); font-weight: 400; margin-left: auto; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim);
     margin: 22px 0 8px; font-weight: 600; }
.card { display: flex; align-items: center; gap: 10px; background: var(--panel);
        border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.card .main { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.card .title { font-weight: 600; font-size: 16px; }
.card .meta { font-size: 12px; color: var(--dim); margin-top: 2px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--dim); }
.dot.claude { background: var(--green); }
.btn { border: 1px solid var(--line); background: #1e222c; border-radius: 9px;
       padding: 8px 12px; font-weight: 600; font-size: 14px; }
.btn:active { background: #2d3444; }
.btn.primary { background: #1f3a2a; border-color: #2d5a3d; color: #9fe8b3; }
.btn.danger { color: var(--red); padding: 8px 10px; }
.btn.small { padding: 5px 9px; font-size: 13px; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.folders .btn { text-align: left; padding: 12px; white-space: nowrap; overflow: hidden;
                text-overflow: ellipsis; }
.empty { color: var(--dim); font-size: 14px; padding: 8px 2px; }
.err { color: var(--red); font-size: 13px; margin: 8px 0; }

/* выбор папки */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; z-index: 20;
         align-items: flex-end; justify-content: center; }
.modal.open { display: flex; }
.sheet { background: var(--panel); width: 100%; max-width: 640px; max-height: 85vh;
         border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
         padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet .head { padding: 14px; border-bottom: 1px solid var(--line); }
.sheet .path { font-size: 13px; color: var(--dim); word-break: break-all; margin-top: 4px; }
.sheet .list { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet .item { display: block; width: 100%; text-align: left; background: none; border: 0;
               border-bottom: 1px solid var(--line); padding: 13px 14px; font-size: 15px; }
.sheet .item:active { background: #232733; }
.sheet .foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.sheet .foot .btn { flex: 1; padding: 12px; }
