/* Widget'a özel kompakt stiller */

.clk-digital {
    text-align: center; flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    min-width: 0; min-height: 0;
    overflow: hidden !important;
}
[data-clk-awrap] {
    overflow: hidden !important;
    min-width: 0; min-height: 0;
}
/* Saat ve tarih metni: dar widget'ta taşmayı engelle */
[data-clk-time] {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
[data-clk-date] {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* Çok dar widget'ta (≤180px) tarih satırı gizlenir, saat yeterli alanı alır */
@container (max-width: 180px) {
    [data-clk-date]  { display: none !important; }
    [data-clk-adate] { display: none !important; }
}
/* Çok küçük widget'ta analog saat maksimum boyutu kısıtla */
@container (max-width: 120px) {
    .clk-analog { max-width: 80px !important; }
}
.clk-analog {
    width: min(60%, 86cqb); aspect-ratio: 1; max-width: 200px;
    max-height: 100%;   /* son emniyet: kadran hiçbir koşulda dikeyde taşmasın */
    align-self: center; color: inherit;
}
.clk-analog [data-h],
.clk-analog [data-m],
.clk-analog [data-s] {
    transform-box: view-box;
    transform-origin: 50px 50px;
}

.wt-row {
    display: flex; align-items: center; gap: clamp(8px, 4cqi, 20px); flex: 1;
    min-width: 0; min-height: 0; overflow: hidden !important;
}
.wt-icon {
    font-size: clamp(1.4rem, 8cqi, 3.6rem);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wt-icon svg { width: 1em; height: 1em; }
.wt-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wt-time { opacity: 0.6; font-size: 0.85em; }
.wt-extras { padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 4px; }
.wt-ext { white-space: nowrap; }

/* ── Weather forecast grid ────────────────────────────────────────── */
.wt-fc-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(3px, 1cqi, 6px);
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.wt-fc-col {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: clamp(5px, 2cqi, 10px) clamp(3px, 1cqi, 6px);
    border-radius: 10px;
    background: rgba(0,0,0,0.20);
    opacity: 1;
}
.wt-fc-day  { font-size: clamp(.58rem, 2.4cqi, .74rem); font-weight: 700; opacity: .55; text-transform: uppercase; letter-spacing: .04em; }
.wt-fc-icon { font-size: clamp(.95rem, 4cqi, 1.35rem); line-height: 1; }
.wt-fc-icon svg { width: 1em; height: 1em; }
.wt-fc-hi   { font-size: clamp(.7rem, 3cqi, .88rem); font-weight: 700; }
.wt-fc-lo   { font-size: clamp(.62rem, 2.5cqi, .78rem); opacity: .45; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wk   { text-align: center; padding: 4px 0; opacity: 0.6; }
.cal-cell {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1; border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    font-size: clamp(0.6rem, 3cqi, 0.92rem); font-weight: 600;
}
.cal-cell.empty { background: transparent; }
.cal-cell.today {
    background: var(--accent); color: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent);
}

.pmd-task    { text-align: center; opacity: 0.75; }
.pmd-time    { text-align: center; font-variant-numeric: tabular-nums; padding: 8px 0; }
.pmd-actions { display: flex; gap: 8px; justify-content: center; }

.cd-grid    { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cd-cell    { text-align: center; padding: 8px 4px !important; }
.cd-label   { text-align: center; opacity: 0.8; }

.notes-area {
    flex: 1; min-height: 60px; resize: none; line-height: 1.5;
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
    color: inherit; padding: 8px 10px; border-radius: 10px;
    outline: none; font-family: var(--font-family, inherit);
    font-size: clamp(0.72rem, 3.5cqi, 0.9rem); transition: border-color 0.2s;
}
.notes-area:focus { border-color: var(--accent); }
.notes-footer { text-align: right; opacity: 0.5; flex-shrink: 0; }

.quote-box  { font-style: italic; }
.quote-text { margin: 0 0 8px; }
.quote-cite { display: block; text-align: right; opacity: 0.7; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; flex: 1; }

.wc-list    { display: flex; flex-direction: column; gap: 6px; }
.wc-row     { padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.16); }

.hb-list    { display: flex; flex-direction: column; gap: 6px; }
.hb-row     {
    padding: 6px 10px; border-radius: 10px;
    background: rgba(0, 0, 0, 0.16);
    cursor: pointer; user-select: none;
}
.hb-row input { accent-color: var(--accent); }

.cur-row    { padding: 8px 0; }
.cur-result { text-align: center; }

.sc-grid {
    display: grid;
    /* Sütun tabanı --sc-cell: simge boyutu ayarından (JS) gelir, kutucuk
       ondan KÜÇÜK olamaz — daralınca simge değil sütun/satır sayısı değişir. */
    grid-template-columns: repeat(auto-fill, minmax(var(--sc-cell, 74px), 1fr));
    gap: clamp(5px, 2cqi, 12px); flex: 1;
    align-content: start; min-height: 0; overflow: auto;
    --sc-icon: 32px; --sc-cell: 74px; --sc-font-size: 0.75rem;
}
.sc-grid.sc-hide-names .sc-box span { display: none; }
/* Ayarlardaki simge boyutu SABİTTİR — küçülmez, sadece yerleşim değişir. */
.sc-box img {
    width:  var(--sc-icon, 32px);
    height: var(--sc-icon, 32px);
    flex-shrink: 0;
}
.sc-edit {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.3);
    color: inherit; cursor: pointer;
    opacity: 0; transition: 0.2s;
    padding: 0; font-size: 0.9rem;
}
.sc-box:hover .sc-edit { opacity: 1; }
.sc-add {
    border: 2px dashed rgba(255, 255, 255, 0.18) !important;
    background: transparent !important;
}

.todo-add-row {
    display: flex; gap: 6px; align-items: stretch; flex-shrink: 0;
}
.todo-input {
    flex: 1;
    background: rgba(0,0,0,0.24); border: 1px solid rgba(255,255,255,0.1);
    color: inherit; padding: 6px 10px; border-radius: 10px;
    outline: none; font-size: clamp(0.72rem, 3.5cqi, 0.92rem);
    font-family: var(--font-family, inherit); transition: border-color 0.2s;
    resize: none; overflow: hidden; max-height: 40cqb;
    line-height: 1.4;
}
.todo-input:focus { border-color: var(--accent); }
.todo-add-btn {
    aspect-ratio: 1 / 1; flex-shrink: 0;
    background: var(--accent); color: #fff; border: none; border-radius: 10px;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: filter 0.2s; margin-right: 2px;
}
.todo-add-btn:hover { filter: brightness(1.12); }
.todo-list {
    display: flex; flex-direction: column; gap: 4px;
    flex: 1; min-height: 0; overflow: auto;
}
.todo-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 5px 8px; border-radius: 10px;
    background: rgba(0, 0, 0, 0.14);
}
.todo-item input[type="checkbox"] {
    accent-color: var(--accent); cursor: pointer;
}
.todo-item .wm-btn { width: 22px; height: 22px; font-size: 0.75rem; }
.todo-check {
    background: transparent; border: none; color: inherit;
    cursor: pointer; padding: 0; flex-shrink: 0;
    display: inline-flex; align-items: center; opacity: 0.65; transition: opacity 0.15s;
    margin-top: 1px;
}
.todo-check:hover { opacity: 1; }
.todo-done .todo-check { color: var(--accent); opacity: 1; }
.todo-text {
    flex: 1; min-width: 0; cursor: pointer;
    overflow-wrap: anywhere; white-space: pre-wrap;
    font-size: clamp(0.72rem, 3.5cqi, 0.92rem);
    line-height: 1.4;
}
.todo-done .todo-text { opacity: 0.4; text-decoration: line-through; }
.todo-del {
    background: transparent; border: none; color: inherit;
    cursor: pointer; padding: 0; flex-shrink: 0;
    display: inline-flex; align-items: center; opacity: 0; transition: opacity 0.15s;
    margin-top: 1px;
}
.todo-item:hover .todo-del { opacity: 0.55; }
.todo-del:hover { opacity: 1 !important; }
.todo-empty { text-align: center; opacity: 0.45; padding: 10px 0; }
.todo-footer { text-align: right; opacity: 0.5; flex-shrink: 0; }

.news-wrap {
    position: relative;
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
}
.news-list {
    display: flex; flex-direction: column; gap: 8px;
    flex: 1; min-height: 0; overflow: auto;
}

/* ── Weather: izin butonu satırı ────────────────────────────────── */
.wt-perm-row {
    display: flex; flex-direction: column; gap: 4px;
    flex-shrink: 0; margin-top: 4px;
}
.wt-perm-btn {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; width: 100%;
}

/* ── Weather: inline şehir arama satırı ─────────────────────────── */
.wt-search-row {
    display: flex; align-items: center; gap: 6px;
    flex-shrink: 0; margin-top: 4px;
}

/* ── News item stilleri ──────────────────────────────────────────── */
.news-item {
    display: flex; align-items: flex-start; gap: clamp(5px, 2cqi, 8px);
    padding: clamp(5px, 2cqi, 9px) clamp(7px, 3cqi, 11px);
    border-radius: 10px;
    background: rgba(0,0,0,0.12);
    text-decoration: none; color: inherit;
    font-size: clamp(0.7rem, 3cqi, 0.88rem);
    line-height: 1.4; flex-shrink: 0;
    transition: background 0.15s;
    animation: news-fade-in 0.25s ease both;
}
.news-item:hover { background: rgba(255,255,255,0.08); }
.news-icon { flex-shrink: 0; opacity: 0.4; padding-top: 2px; }
.news-text { flex: 1; min-width: 0; }
.news-meta { opacity: 0.42; font-size: 0.82em; margin-left: 3px; white-space: nowrap; }
.news-empty {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center; opacity: 0.6;
    padding: 18px 6px; font-size: clamp(0.7rem, 3cqi, 0.85rem);
}
.news-empty-detail {
    font-size: 0.85em; opacity: 0.6; line-height: 1.5;
    max-width: 100%; word-break: break-word;
}
@keyframes news-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: none; }
}

/* ── News: durum satırı, tekrar-dene ve yenile düğmesi ───────────── */
.news-status {
    flex-shrink: 0; margin-top: 6px; padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: clamp(0.62rem, 2.4cqi, 0.75rem);
    opacity: 0.6; line-height: 1.4;
}
.news-link {
    background: none; border: none; padding: 0;
    color: var(--accent, #7d8cff); cursor: pointer;
    font: inherit; text-decoration: underline;
}
.news-link:hover { opacity: 0.8; }

.news-refresh {
    position: absolute; top: -2px; right: -2px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0;
    border: none; border-radius: 6px;
    background: rgba(0,0,0,0.35); color: inherit;
    cursor: pointer; opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}
.widget:hover .news-refresh { opacity: 0.5; }
.news-refresh:hover { opacity: 1 !important; background: rgba(0,0,0,0.55); }
.news-busy .news-refresh { opacity: 0.9; animation: news-spin 0.9s linear infinite; }
@keyframes news-spin { to { transform: rotate(360deg); } }

.news-skeleton {
    height: 34px; border-radius: 10px; flex-shrink: 0;
}

/* ── Pomodoro ──────────────────────────────────────────────────────── */
.pom-wrap {
    display: flex; align-items: center; justify-content: center;
    flex: 1; min-height: 0;
    overflow: hidden !important;
}
.pom-disk {
    position: relative;
    container-type: inline-size;
    flex-shrink: 0;
}
.pom-ring {
    width: 100%; height: 100%; overflow: visible;
}
.pom-track   { stroke: rgba(255,255,255,0.12); }
.pom-progress {
    stroke: var(--accent);
    transform: rotate(-90deg); transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.4s linear;
}
.pom-mode-break .pom-progress { stroke: #4ade80; }
.pom-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; text-align: center; pointer-events: none;
}
.pom-time    { font-size: clamp(1rem, 18cqi, 4rem); font-weight: 700; line-height: 1; }
.pom-mode    { font-size: clamp(.6rem, 6cqi, 1.1rem); opacity: .8; }
.pom-session { font-size: clamp(.55rem, 5cqi, .9rem); opacity: .55; }
.pom-controls {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 4px 0; flex-shrink: 0;
}
.pom-btn {
    width: clamp(28px, 8cqi, 44px); height: clamp(28px, 8cqi, 44px);
    border-radius: 50%; border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08); color: inherit; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.pom-btn:hover { background: rgba(255,255,255,0.18); }

/* ── Crypto ──────────────────────────────────────────────────────── */
.cry-list {
    display: flex; flex-direction: column; gap: 5px;
    flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0;
}
.cry-row {
    display: flex; align-items: center; gap: clamp(4px, 2cqi, 8px);
    padding: 6px 8px; border-radius: 10px; background: rgba(0,0,0,0.15);
    flex-shrink: 0; min-width: 0;
}
.cry-name   { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cry-sym    { font-weight: 700; font-size: clamp(0.72rem, 4cqi, 0.95rem); }
.cry-price  {
    font-variant-numeric: tabular-nums; font-weight: 600;
    font-size: clamp(0.68rem, 3.5cqi, 0.92rem); flex-shrink: 0;
}
.cry-change {
    font-size: clamp(0.65rem, 3cqi, 0.85rem); font-weight: 600;
    font-variant-numeric: tabular-nums; text-align: right; flex-shrink: 0;
}
.cry-up { color: #4ade80; }
.cry-dn { color: #f87171; }
.cry-spark  { display: block; flex-shrink: 0; opacity: 0.85; }

/* ── Quotes ──────────────────────────────────────────────────────── */
.qte-wrap {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden !important;
    padding: clamp(2px, 1cqi, 6px) clamp(2px, 1cqi, 4px) 0;
}
.qte-mark {
    display: block;
    font-size: clamp(1.8rem, 10cqi, 3.2rem);
    line-height: 0.6;
    opacity: 0.18;
    font-family: Georgia, 'Times New Roman', serif;
    /* flex-shrink:1 → küçük widget'ta sıkışmak yerine küçülür */
    flex-shrink: 1;
    max-height: 3.5rem; overflow: hidden;
    pointer-events: none; user-select: none;
    padding-bottom: 2px;
}
.qte-text {
    font-style: italic; font-weight: 500;
    font-size: clamp(0.72rem, 3.5cqi, 1rem);
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    flex: 1; min-height: 0;
    padding-left: clamp(4px, 1cqi, 8px);
}
.qte-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; flex-shrink: 0;
    padding-top: clamp(3px, 1.5cqi, 6px);
    margin-top: auto;
}
.qte-author {
    font-style: normal; opacity: 0.6; flex: 1; min-width: 0;
    font-size: clamp(0.6rem, 2.8cqi, 0.82rem);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qte-actions {
    display: flex; gap: 4px; flex-shrink: 0;
}
.qte-btn {
    width: clamp(20px, 5cqi, 28px); height: clamp(20px, 5cqi, 28px); border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: inherit; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.2s; flex-shrink: 0;
}
.qte-btn:hover { background: rgba(255,255,255,0.14); }

/* Container query: dar widget'ta alıntı metni basitleşir */
@container (max-width: 220px) {
    .qte-mark  { display: none; }
    .qte-text  { -webkit-line-clamp: 3; }
}
@container (max-width: 150px) {
    .qte-actions { display: none; }
    .qte-text    { -webkit-line-clamp: 2; }
}

